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

Support for sharding wide rows in CQL 3.0

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Normal
    • Resolution: Won't Fix
    • None
    • Legacy/CQL
    • None

    Description

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            nickmbailey Nick Bailey
            Votes:
            3 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: