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

SASI index on partition key part doesn't match

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • 3.11.0
    • Feature/SASI
    • Normal

    Description

      I created a SASI index on first part of multi-part partition key. Running query using that index doesn't seem to work.

      I have here a log of queries that should indicate the issue:

      cqlsh:test> CREATE TABLE test1(name text, event_date date, data_type text, bytes int, PRIMARY KEY ((name, event_date), data_type));
      cqlsh:test> CREATE CUSTOM INDEX test_index ON test1(name) USING 'org.apache.cassandra.index.sasi.SASIIndex';
      cqlsh:test> INSERT INTO test1(name, event_date, data_type, bytes) values('1234', '2010-01-01', 'sensor', 128);
      cqlsh:test> INSERT INTO test1(name, event_date, data_type, bytes) values('abcd', '2010-01-02', 'sensor', 500);
      cqlsh:test> select * from test1 where NAME = '1234';
      
       name | event_date | data_type | bytes
      ------+------------+-----------+-------
      
      (0 rows)
      cqlsh:test> CONSISTENCY ALL;
      Consistency level set to ALL.
      cqlsh:test> select * from test1 where NAME = '1234';
      
       name | event_date | data_type | bytes
      ------+------------+-----------+-------
      
      (0 rows)

      Note! Creating a SASI index on single part partition key, SASI index creation fails. Apparently this should not work at all, so is it about missing validation on index creation?

      Attachments

        Issue Links

          Activity

            People

              adelapena Andres de la Peña
              hkroger Hannu Kröger
              Andres de la Peña
              Alex Petrov
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: