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

Wrong search results if clustering column has SASI index

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Urgent
    • Resolution: Duplicate
    • None
    • None
    • Critical

    Description

      Cassandra 3.5.

      Code snippet to reproduce the issue:

      DROP keyspace if exists kmv;
      CREATE keyspace if not exists kmv WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor':'1'} ;
      USE kmv;
      
      CREATE TABLE if not exists kmv (id int, c1 text, PRIMARY KEY(id,c1));
      
      CREATE CUSTOM INDEX ON kmv.kmv  ( c1 ) USING 'org.apache.cassandra.index.sasi.SASIIndex' WITH OPTIONS = {
      'analyzed' : 'true',
      'analyzer_class' : 'org.apache.cassandra.index.sasi.analyzer.NonTokenizingAnalyzer',
      'case_sensitive' : 'false', 
      'mode' : 'CONTAINS'
      };
      
      INSERT into kmv (id, c1) values (1, 'qweasd') ;
      INSERT into kmv (id, c1) values (1, 'uuu') ;
      INSERT into kmv (id, c1) values (2, 'qwe') ;
      

      c1 is a clustering column with SASI index.
      An attempt to add a restriction for partition key AND for the clustering column leads to incorrect results:

      SELECT c1 from kmv.kmv where id=1 and c1 like '%qwe%';
      

      Expected results:
      qweasd
      Actual results:
      qweasd, uuu

      Looks like a restriction for c1 was ignored.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mkrupits_jb Mikhail Krupitskiy
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: