cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jonathan Ellis (Commented) (JIRA)" <>
Subject [jira] [Commented] (CASSANDRA-2474) CQL support for compound columns
Date Fri, 16 Dec 2011 23:24:31 GMT


Jonathan Ellis commented on CASSANDRA-2474:

How about this?

CREATE TABLE timeline (
    userid int primary key,
    posted_at uuid,
    posted_by int,
    body text
) TRANSPOSED AS (posted_at), SPARSE(posted_by, body);

SELECT, INSERT, and UPDATE syntax requires no changes.

The SPARSE keyword means this is a "dynamic" composite column.  Thus, the actual composite
columns stored here might be {(08ec87a0-2cc3-4982-a0e7-a434884451f8, 'posted_by'): 524342}
and {(08ec87a0-2cc3-4982-a0e7-a434884451f8, 'body'): 'CQL FTW'}. That is, the column name
literals 'posted_by' and 'body' are part of the composite column name.  It will take one composite
column per SPARSE column to store a transposed row.

{{ALTER TABLE timeline ADD location int;}} would add location to the sparse subcolumns.

    series text primary key,
    ts1 int,
    cat text,
    subcat text,
    id uuid
) TRANSPOSED AS (ts1, cat, subcat, id);

There are no sparse components; an example column stored might be (2355234412, 'trucks', 'Ford',
2165cd4c-4db8-4a8f-a2b2-e8fa157f7697).  Each transposed row is represented by one column.
 {{ALTER TABLE events}} would not be allowed.

> CQL support for compound columns
> --------------------------------
>                 Key: CASSANDRA-2474
>                 URL:
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API, Core
>            Reporter: Eric Evans
>            Assignee: Pavel Yaskevich
>              Labels: cql
>             Fix For: 1.1
>         Attachments: 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:!default.jspa
For more information on JIRA, see:


View raw message