maedhroz commented on code in PR #4561:
URL: https://github.com/apache/cassandra/pull/4561#discussion_r2829504528
##########
src/java/org/apache/cassandra/index/sai/plan/Expression.java:
##########
@@ -324,6 +324,10 @@ public boolean isSatisfiedBy(ByteBuffer columnValue)
private boolean validateStringValue(ByteBuffer columnValue, ByteBuffer
requestedValue)
{
+ if (indexTermType.isFrozenCollection() &&
+ (operator == IndexOperator.CONTAINS_VALUE || operator ==
IndexOperator.CONTAINS_KEY))
+ return termMatches(columnValue, requestedValue);
Review Comment:
I modified one of the tests to try to use an analyzer...
```
@Test
public void testFrozenSetValuesIndex()
{
createTable("CREATE TABLE %s (pk int PRIMARY KEY, frozen_set
frozen<set<text>>)");
createIndex("CREATE INDEX ON %s(VALUES(frozen_set)) USING 'sai' WITH
OPTIONS = { 'case_sensitive' : false }");
execute("INSERT INTO %s (pk, frozen_set) VALUES (1, {'apple',
'Banana'})");
execute("INSERT INTO %s (pk, frozen_set) VALUES (2, {'banana',
'cherry'})");
execute("INSERT INTO %s (pk, frozen_set) VALUES (3, {'cherry',
'date'})");
ResultSet rows = executeNet("SELECT pk FROM %s WHERE frozen_set CONTAINS
'banana'");
assertEquals(2, rows.all().size());
flush();
rows = executeNet("SELECT pk FROM %s WHERE frozen_set CONTAINS
'banana'");
assertEquals(2, rows.all().size());
}
```
This fails to find/match the capitalized "Banana". It works in the
non-frozen case, and it also seems to work if you just remove this new block
above and let the following logic execute. Anyway, throw a couple new tests
around that (or parameterize the existing ones), and see how it goes.
--
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]