dcapwell commented on code in PR #3995: URL: https://github.com/apache/cassandra/pull/3995#discussion_r2006414822
########## test/unit/org/apache/cassandra/cql3/ast/AssignmentOperator.java: ########## @@ -53,31 +53,30 @@ public AssignmentOperator(Kind kind, Expression right) this.right = right; } - public static EnumSet<Kind> supportsOperators(AbstractType<?> type) + public static EnumSet<Kind> supportsOperators(AbstractType<?> type, boolean isTransaction) { type = type.unwrap(); EnumSet<Kind> result = EnumSet.noneOf(Kind.class); + if (type instanceof CollectionType && type.isMultiCell()) + { + if (type instanceof SetType || type instanceof ListType) + return EnumSet.of(Kind.ADD, Kind.SUBTRACT); + if (type instanceof MapType) + { + // map supports subtract, but not map - map; only map - set! Review Comment: i wouldn't add a JIRA unless someone wants that feature. `map -=` acts on the key level, which can be done without a transaction (CAS or Accord), where as `remove(key, value)` would need to know the current value, which isn't behavior we like to support outside of transactions. -- 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: pr-unsubscr...@cassandra.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org For additional commands, e-mail: pr-h...@cassandra.apache.org