maedhroz commented on code in PR #4561:
URL: https://github.com/apache/cassandra/pull/4561#discussion_r2824644693
##########
src/java/org/apache/cassandra/cql3/restrictions/SimpleRestriction.java:
##########
@@ -397,13 +418,28 @@ else if (isIN())
// TODO only map elements supported for now
if (columnsExpression.isMapElementExpression())
{
+ // For frozen maps, only SAI indexes can support map entry
predicates
+ if (column.type.isCollection() &&
!column.type.isMultiCell())
+ {
+ for (Index index : indexRegistry.listIndexes())
+ {
+ if (index.dependsOn(column))
+ {
+ if (!(index instanceof StorageAttachedIndex))
+ {
+ throw invalidRequest("Map-entry predicates
on frozen map column %s are not supported", column.name);
+ }
+ }
+ }
+ }
Review Comment:
Another option here is just to add this to the `Index` interface, default
the method to return false, and have SAI return true. (ie.
`Index#supportsMapElementExpression()`) Then we don't have to get into all the
`instanceof` stuff.
--
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]