mike-tr-adamson commented on code in PR #2673:
URL: https://github.com/apache/cassandra/pull/2673#discussion_r1341556033
##########
src/java/org/apache/cassandra/cql3/restrictions/StatementRestrictions.java:
##########
@@ -276,8 +290,25 @@ else if (relation.isLIKE())
}
if (hasQueriableIndex)
usesSecondaryIndexing = true;
- else if (!allowFiltering && requiresAllowFilteringIfNotSpecified())
- throw invalidRequest(allowFilteringMessage(state));
+ else
+ {
+ if (nonPrimaryKeyRestrictions.hasAnn())
+ {
+ var vectorColumn =
nonPrimaryKeyRestrictions.getColumnDefs().stream().filter(c ->
c.type.isVector()).findFirst();
Review Comment:
I had to play around with this a bit but the following test fails because of
this:
```
@Test
public void multipleVectorColumnsTest()
{
createTable("CREATE TABLE %s (k int PRIMARY KEY, v1 vector<float,
1>, v2 vector<float, 1>)");
createIndex("CREATE CUSTOM INDEX ON %s(v1) USING
'StorageAttachedIndex'");
execute("INSERT INTO %s (k, v1, v2) VALUES (1, [1], [2])");
execute("SELECT * FROM %s WHERE v1 = [1] ORDER BY v2 ANN OF [2]
ALLOW FILTERING");
}
```
The problem is that we have a `vectorColumn` and we have a `vectorIndex`,
just neither of them in the correct places. We need to check that we have the
correct `vectorColumn` for the each test.
--
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]