Details

    • Sub-task
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • 0.8.1
    • Legacy/CQL

    Description

      With the completion of CASSANDRA-2396, it is now possible to attach a name to keys (column family-wide). This could be utilized to introduce the concept of "virtual columns" in CQL. Here's how that would work:

      Typically you would use the CQL keyword KEY to specify a row key, for example:

      CQL 1.0
      INSERT INTO cf (KEY, name1, name2) VALUES (key1, value1, value2)
      -- or alternately
      UPDATE cf SET name1 = value1, name2 = value2 WHERE KEY = key1
      
      SELECT name1,name2 FROM cf WHERE KEY = key1
      

      For CQL 1.1, that syntax would continue to work, but upon the completion of this issue it should also be possible to assign a name to the key and treat as if it were another column. For example:

      CQL 1.1
      INSERT INTO cf (keyname, name1, name2) VALUES (key1, value1, value2)
      -- or alternately
      UPDATE cf SET name1 = value1, name2 = value2 WHERE keyname = key1
      
      -- Note how the keyname can now be used in the projection
      SELECT keyname, name1, name2 FROM cf WHERE keyname = key1
      
      -- And, there is no restriction on the order
      SELECT name1, name2, keyname FROM cf WHERE keyname = key1 AND name2 = value2
      

      The semantics will be such that the existing behavior is maintained (read: when using the KEY keyword), but if the key is named, and the name is used in a SELECT, the key's name and value will be returned in the column results, sorted according to the comparator (Note: we'll need to figure out what that means with respect to differently typed keys).

      Attachments

        1. 2480-v4-wip.txt
          30 kB
          Jonathan Ellis
        2. CASSANDRA-2480.patch
          29 kB
          Pavel Yaskevich
        3. CASSANDRA-2480-v2.patch
          31 kB
          Pavel Yaskevich
        4. CASSANDRA-2480-v3.patch
          32 kB
          Pavel Yaskevich
        5. CASSANDRA-2480-v5.patch
          32 kB
          Pavel Yaskevich

        Activity

          People

            xedin Pavel Yaskevich
            urandom Eric Evans
            Pavel Yaskevich
            Jonathan Ellis
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: