mazhenlin commented on CASSANDRA-15169:

Yes, I have seen the failure . The OnDiskIndexTest.testNotEqualsQueryForStrings 
test case shows that using '=' for prefix matching seems to be a feature other 
than a bug .  However,  the inconsistent behavior between MemIndex and 
OnDiskIndex (when is_literal = true ) still need to be fixed. Comparison for  
blob type is also incorrect .


We have two choices:

1 Do not use = for prefix match since 'like' is already supported.

2 Use '=' for prefix matching only when is_literal = true.


Personally I like 1, but 2 may be  better considering that someone might have 
already used this feature. Which do you prefer ? [~mck]

> SASIIndex does not compare strings correctly
> --------------------------------------------
>                 Key: CASSANDRA-15169
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-15169
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Feature/SASI
>            Reporter: mazhenlin
>            Assignee: mazhenlin
>            Priority: Normal
>         Attachments: CASSANDRA-15169-v1.patch
> In our scenario, we need to query with '>' conditions on string columns. So I 
> created index with  is_literal = false. like the following:
> {code:java}
> CREATE TABLE test (id int primary key, t text);
> 'org.apache.cassandra.index.sasi.SASIIndex' WITH OPTIONS = {'is_literal': 
> 'false'};
> {code}
>  I also inserted some records and query:
> {code:java}
> insert into test(id,t) values(1,'abc');
> select * from test where t > 'ab';
> {code}
> At first ,it worked. But after flush, the query returned none record.
> I have read the code of SASIIndex and found that it is because in the 
> {code:java}
> Expression.isLowerSatisfiedBy{code}
> function,
> {code:java}
> term.compareTo{code}
> was called with parameter checkFully=false, which cause the string 'abc' was 
> only compared with its first 2 characters( length of expression value).
> I have wrote a UT for this case and fixed it.

This message was sent by Atlassian Jira

To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to