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

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

The more I think about it the less happy I am with omitting support for sparse 
columns.  Remember that dense composites may only be inserted and deleted, not 
updated, since they are just a tuple of values with "column names" determined 
by schema and/or convention.

I think we can support sparse columns well in a way that improves the 
conceptual integrity for the dense composites as well:

{code}
-- "column" and "value" are sparse; a transposed row will be stored as
-- two columns of (user_id, posted_at, 'column': string) and (user_id, 
posted_at, 'value': blob)
CREATE TABLE timeline (
    user_id int,
    posted_at uuid,
    column string,
    value blob,    
    PRIMARY KEY(user_id, posted_at)
) TRANSPOSED;

-- entire transposed row is stored as a single dense composite column
-- (series, ts1, cat, subcat, 1337, 92d21d0a-...: []).  Note that the
-- composite column's value is unused in this case.
CREATE TABLE events (
    series text,
    ts1 int,
    cat text,
    subcat text,
    "1337" uuid,
    "92d21d0a-d6cb-437c-9d3f-b67aa733a19f" bigint,
    PRIMARY KEY(series, ts1, cat, subcat, "1337", 
"92d21d0a-d6cb-437c-9d3f-b67aa733a19f")
) TRANSPOSED WITH COLUMN NAMES ("1337" int, 
"92d21d0a-d6cb-437c-9d3f-b67aa733a19f" uuid);
{code}

Thus, columns included in the (transposed) primary key will be "dense," and not 
updateable, which conforms to our existing practice that keys are not 
updateable.  Remaining columns will be updateable since they will each map to a 
separate physical column.
                
> 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-no-sparse.PNG, 2474-transposed-select.PNG, 
> raw_composite.txt, 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