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

SASIIndex and Clustering Key interaction

Agile BoardAttach filesAttach ScreenshotBulk Copy AttachmentsBulk Move AttachmentsVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Low
    • Resolution: Fixed
    • None
    • Feature/SASI
    • None
    • Low

    Description

      Not sure if this is the right place to ask, but it has been a couple days and I haven't been able to figure this out.

      The current setup of my table is as such:

      CREATE TABLE test.user_codes (
          user_uuid text,
          code text,
          description text
          PRIMARY KEY (user_uuid, code)
      );
      CREATE CUSTOM INDEX user_codes_code_idx ON test.user_codes
      (code) USING 'org.apache.cassandra.index.sasi.SASIIndex' WITH OPTIONS =
      {'analyzer_class': 'org.apache.cassandra.index.sasi.analyzer.NonTokenizingAnalyzer', 
      'case_sensitive': 'false', 'mode': 'CONTAINS', 'analyzed': 'true'};
      
      CREATE CUSTOM INDEX user_codes_description_idx ON test.user_codes
      (description) USING 'org.apache.cassandra.index.sasi.SASIIndex' WITH OPTIONS =
      {'analyzer_class': 'org.apache.cassandra.index.sasi.analyzer.NonTokenizingAnalyzer', 
      'case_sensitive': 'false', 'mode': 'CONTAINS', 'analyzed': 'true'};
      

      I can successfully make the following call:

      SELECT * FROM user_codes WHERE user_uuid='xxxx' and description like 'Test%';
      

      However, I can't make a similar call unless I allow filtering:

      SELECT * FROM user_codes WHERE user_uuid='xxxx' and code like 'Test%';
      

      I believe this is because the field `code` is a clustering key, but cannot figure out the proper way to set up the table such that the second call also works.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned Assign to me
            justinhwang Justin Hwang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment