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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Low
    • Resolution: Fixed
    • 2.0.9, 2.1 rc1
    • Legacy/CQL
    • None
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: