Alexander Nabatchikov created CASSANDRA-13543:
-------------------------------------------------

             Summary: Cassandra SASI index gives unexpected number of results
                 Key: CASSANDRA-13543
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-13543
             Project: Cassandra
          Issue Type: Bug
          Components: sasi
            Reporter: Alexander Nabatchikov


I've faced the issue with LIKE query to the column indexed by SASI index. 
Cassandra can return different number of rows when the data stays immutable.

{code}
CREATE TABLE idx_test
(
        id int,
        str text,
        i int,
        PRIMARY KEY (id)
);


CREATE CUSTOM INDEX idx_test_idx ON idx_test (str)
USING 'org.apache.cassandra.index.sasi.SASIIndex'
WITH OPTIONS = { 
        'mode': 'CONTAINS',
        'analyzer_class': 
'org.apache.cassandra.index.sasi.analyzer.StandardAnalyzer',
        'tokenization_enable_stemming': 'true',
        'tokenization_normalize_lowercase': 'true'
};

INSERT INTO idx_test (id, str, i) VALUES (1, 'a b c d', 10);
INSERT INTO idx_test (id, str, i) VALUES (2, 'a b c d', 10);
INSERT INTO idx_test (id, str, i) VALUES (3, 'a b c d', 10);
INSERT INTO idx_test (id, str, i) VALUES (4, 'a b c d', 10);
INSERT INTO idx_test (id, str, i) VALUES (5, 'a b c d', 10);
INSERT INTO idx_test (id, str, i) VALUES (6, 'a b c d', 10);
INSERT INTO idx_test (id, str, i) VALUES (7, 'a b c d', 10);
INSERT INTO idx_test (id, str, i) VALUES (8, 'a b c d', 10);
INSERT INTO idx_test (id, str, i) VALUES (9, 'a b c d', 10);
INSERT INTO idx_test (id, str, i) VALUES (10, 'a b c d', 10);
{code}

Query:
{code}
SELECT * FROM idx_test WHERE str LIKE 'b' 
AND i = 10
ALLOW FILTERING;
{code}

This query mostly returns 0 rows, but sometimes 1 row appears in result row set 
as:
{code}
id |  i  |  str
10 |  10 |  a b c d
{code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to