[ 
https://issues.apache.org/jira/browse/CASSANDRA-2474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13172625#comment-13172625
 ] 

Jonathan Ellis commented on CASSANDRA-2474:
-------------------------------------------

bq. you have not way to give the type of that last component; and if it's not 
text, the notation won't look so nice

Okay, so we can make the following minor changes to make the syntax more 
flexible:

- Drop the AS and the first list from TRANSPOSED AS; all columns are 
transposed, so we can just list the sparse ones (which may occur anywhere in 
the list):
- Allow an optional WITH (or AND, if there is already a WITH SPARSE) clause of 
COLUMN NAMES that includes the name type.

So my first example would become
{noformat}
CREATE TABLE timeline (
    userid int primary key,
    posted_at uuid,
    posted_by int,
    body text
) TRANSPOSED WITH SPARSE(posted_by, body);
{noformat}

A more complex one including some non-utf8 types might be
{noformat}
CREATE TABLE events (
    series text primary key,
    ts1 int,
    cat text,
    subcat text,
    "1337" uuid,
    "92d21d0a-d6cb-437c-9d3f-b67aa733a19f" bigint
) TRANSPOSED WITH COLUMN NAMES ("1337" int, 
"92d21d0a-d6cb-437c-9d3f-b67aa733a19f" uuid);
{noformat}

(I'm waving my hands a bit here and using "" to denote quotes-to-help-parsing 
rather than quotes-to-indicate-string.  This is the convention postgresql uses.)

bq. the notation only work if the 'sparse' component is the last one, which may 
be the case for "transposition of super columns", but feels arbitrarily limited 
otherwise

True, but none of the other proposals even come *close* to being as friendly as 
this one for typical cases, so I think we're in the right space to "make common 
things easy and unusual things possible."  Tree-like sparse models may also 
fall into the "belongs in the CASSANDRA-3647 document/destructuring api ticket. 
 If not, maybe we need the three-tuple model as well (but I'd rather let that 
slide until/unless we have a real need for it).
                
> CQL support for compound columns
> --------------------------------
>
>                 Key: CASSANDRA-2474
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2474
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API, Core
>            Reporter: Eric Evans
>            Assignee: Pavel Yaskevich
>              Labels: cql
>             Fix For: 1.1
>
>         Attachments: 2474-transposed-1.PNG, 2474-transposed-raw.PNG, 
> 2474-transposed-select.PNG, screenshot-1.jpg, screenshot-2.jpg
>
>
> For the most part, this boils down to supporting the specification of 
> compound column names (the CQL syntax is colon-delimted terms), and then 
> teaching the decoders (drivers) to create structures from the results.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to