Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-3761 CQL 3.0
  3. CASSANDRA-4176

Support for sharding wide rows in CQL 3.0

Agile BoardAttach filesAttach ScreenshotVotersWatch issueWatchersConvert to IssueMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments


    • Type: Sub-task
    • Status: Resolved
    • Priority: Normal
    • Resolution: Won't Fix
    • Fix Version/s: None
    • Component/s: Legacy/CQL
    • Labels:


      CQL 3.0 currently has support for defining wide rows by declaring a composite primary key. For example:

      CREATE TABLE timeline (
          user_id varchar,
          tweet_id uuid,
          author varchar,
          body varchar,
          PRIMARY KEY (user_id, tweet_id)

      It would also be useful to manage sharding a wide row through the cql schema. This would require being able to split up the actual row key in the schema definition. In the above example you might want to make the row key a combination of user_id and day_of_tweet, in order to shard timelines by day. This might look something like:

      CREATE TABLE timeline (
          user_id varchar,
          day_of_tweet date,
          tweet_id uuid,
          author varchar,
          body varchar,
          PRIMARY KEY (user_id REQUIRED, day_of_tweet REQUIRED, tweet_id)

      Thats probably a terrible attempt at how to structure that in CQL. But I think I've gotten the point across. I tagged this for cql 3.0, but I'm honestly not sure how much work it might be. As far as I know built in support for composite keys is limited.





              • Created:

                Issue deployment