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

Genralize use of IN for compound partition keys

Agile BoardAttach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

      Description

      When you have a compount partition key, we currently only support to have a IN on the last column of that partition key. So given:

      CREATE TABLE foo (
          k1 int,
          k2 int,
          v int,
          PRIMARY KEY ((k1, k2))
      )
      

      we allow

      SELECT * FROM foo WHERE k1 = 0 AND k2 IN (1, 2)
      

      but not

      SELECT * FROM foo WHERE k1 IN (0, 1) AND k2 IN (1, 2)
      

      There is no particular reason for us not supporting the later (to the best of my knowledge) since it's reasonably straighforward, so we should fix it.

      I'll note that using IN on a partition key is not necessarily a better idea than parallelizing queries server client side so this syntax, when introduced, should probably be used sparingly, but given we do support IN on partition keys, I see no reason not to extend it to compound PK properly.

        Attachments

          Activity

            People

            • Assignee:
              blerer Benjamin Lerer Assign to me
              Reporter:
              slebresne Sylvain Lebresne
              Authors:
              Benjamin Lerer
              Reviewers:
              Sam Tunnicliffe

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment