bbotella commented on code in PR #3995:
URL: https://github.com/apache/cassandra/pull/3995#discussion_r2006118679


##########
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:
   That's... an interesting finding. Should we have a Jira to add proper 
support?



##########
test/harry/main/org/apache/cassandra/harry/model/ASTSingleTableModel.java:
##########
@@ -893,28 +942,60 @@ private List<Clustering<ByteBuffer>> keys(Map<Symbol, 
List<? extends Expression>
         return 
current.stream().map(BufferClustering::new).collect(Collectors.toList());
     }
 
+    private static ByteBuffer eval(Symbol col, @Nullable ByteBuffer current, 
Expression e)
+    {
+        if (!(e instanceof AssignmentOperator)) return eval(e);
+        // multi cell collections have the property that they do update even 
if the current value is null
+        boolean isFancy = col.type().isCollection() && 
col.type().isMultiCell();

Review Comment:
   Curious about the `isFancy` name choosing :-)



-- 
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

Reply via email to