Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-6875

CQL3: select multiple CQL rows in a single partition using IN

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Low
    • Resolution: Fixed
    • Fix Version/s: 2.0.9, 2.1 rc1
    • Component/s: Legacy/CQL
    • Labels:
      None
    • Severity:
      Low

      Description

      In the spirit of CASSANDRA-4851 and to bring CQL to parity with Thrift, it is important to support reading several distinct CQL rows from a given partition using a distinct set of "coordinates" for these rows within the partition.

      CASSANDRA-4851 introduced a range scan over the multi-dimensional space of clustering keys. We also need to support a "multi-get" of CQL rows, potentially using the "IN" keyword to define a set of clustering keys to fetch at once.

      (reusing the same example:)

      Consider the following table:

      CREATE TABLE test (
        k int,
        c1 int,
        c2 int,
        PRIMARY KEY (k, c1, c2)
      );
      

      with the following data:

       k | c1 | c2
      ---+----+----
       0 |  0 |  0
       0 |  0 |  1
       0 |  1 |  0
       0 |  1 |  1
      

      We can fetch a single row or a range of rows, but not a set of them:

      > SELECT * FROM test WHERE k = 0 AND (c1, c2) IN ((0, 0), (1,1)) ;
      Bad Request: line 1:54 missing EOF at ','
      

      Supporting this syntax would return:

       k | c1 | c2
      ---+----+----
       0 |  0 |  0
       0 |  1 |  1
      

      Being able to fetch these two CQL rows in a single read is important to maintain partition-level isolation.

        Attachments

        1. 6875-part2.txt
          6 kB
          Tom Hobbs
        2. 6875-part2-v2.txt
          7 kB
          Sylvain Lebresne

          Issue Links

            Activity

              People

              • Assignee:
                thobbs Tom Hobbs
                Reporter:
                nff Nicolas Favre-Felix
                Authors:
                Tom Hobbs
                Reviewers:
                Sylvain Lebresne
              • Votes:
                0 Vote for this issue
                Watchers:
                10 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: