adelapena commented on PR #2556:
URL: https://github.com/apache/cassandra/pull/2556#issuecomment-1801808523
Albeit the reversal of the support for `!=` and `NOT IN` on indexed columns
has made it necessary to use `ALLOW FILTERING` again, it seems that the indexes
are still involved in the query and producing wrong results:
```java
@Test
public void notInTest()
{
createTable("CREATE TABLE %s (k int PRIMARY KEY, v int)");
execute("INSERT INTO %s (k, v) VALUES (1, 1)");
execute("INSERT INTO %s (k, v) VALUES (2, 2)");
execute("INSERT INTO %s (k, v) VALUES (3, 3)");
execute("INSERT INTO %s (k, v) VALUES (4, 4)");
String query = "SELECT * FROM %s WHERE v NOT IN (1, 4) ALLOW FILTERING";
Object[][] rows = rows(row(2, 2), row(3, 3));
assertRowsIgnoringOrder(execute(query), rows);
createIndex("CREATE INDEX ON %s(v) USING 'sai'");
waitForTableIndexesQueryable();
assertRowsIgnoringOrder(execute(query), rows); // Got 1 extra row(s) in
result: (k=1, v1=1)
}
```
I suggest we add some additional tests around the use of unsupported
operators with SAI indexes and `ALLOW FILTERING`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]