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

Filtering for CONTAINS (KEY) on frozen collection clustering columns within a partition does not work

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Low
    • Resolution: Fixed
    • 2.1.3
    • None
    • None
    • Low

    Description

      Create a table like this:

      CREATE TABLE foo (
          a int,
          b int,
          c frozen<set<int>>
          d int,
          PRIMARY KEY (a, b, c, d)
      )
      

      and add an index on it:

      CREATE INDEX ON foo(b)
      

      A query across all partitions will work correctly:

      cqlsh:ks1> insert into foo (a, b, c, d) VALUES (0, 0, {1, 2}, 0);
      cqlsh:ks1> SELECT * FROM foo WHERE b=0 AND c CONTAINS 2 and d=0 ALLOW FILTERING;
      
       a | b | c      | d
      ---+---+--------+---
       0 | 0 | {1, 2} | 0
      
      (1 rows)
      

      But if the query is restricted to a single partition, it is considered invalid (and the error message isn't great):

      cqlsh:ks1> SELECT * FROM foo WHERE a=0 AND b=0 AND c CONTAINS 2 and d=0 ALLOW FILTERING;
      code=2200 [Invalid query] message="No secondary indexes on the restricted columns support the provided operators: "
      

      Attachments

        1. 8302.txt
          6 kB
          Tom Hobbs

        Activity

          People

            thobbs Tom Hobbs
            thobbs Tom Hobbs
            Tom Hobbs
            Benjamin Lerer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: