aweisberg commented on code in PR #4044:
URL: https://github.com/apache/cassandra/pull/4044#discussion_r2032094090


##########
test/harry/main/org/apache/cassandra/harry/model/ASTSingleTableModel.java:
##########
@@ -219,25 +389,25 @@ private void update(Mutation.Insert insert)
         Map<Symbol, Expression> values = insert.values;
         if (!factory.staticColumns.isEmpty() && 
!Sets.intersection(factory.staticColumns.asSet(), values.keySet()).isEmpty())
         {
-            // static columns to add in.  If we are doing something like += to 
a row that doesn't exist, we still update statics...
-            Map<Symbol, ByteBuffer> write = new HashMap<>();
-            for (Symbol col : Sets.intersection(factory.staticColumns.asSet(), 
values.keySet()))
-                write.put(col, eval(values.get(col)));
-            partition.setStaticColumns(write);
+            
maybeUpdateColumns(Sets.intersection(factory.staticColumns.asSet(), 
values.keySet()),
+                               partition.staticRow(),
+                               nowTs, values,
+                               partition::setStaticColumns);
         }
         // table has clustering but non are in the write, so only pk/static 
can be updated
         if (!factory.clusteringColumns.isEmpty() && 
Sets.intersection(factory.clusteringColumns.asSet(), values.keySet()).isEmpty())
             return;
-        Map<Symbol, ByteBuffer> write = new HashMap<>();
-        for (Symbol col : Sets.intersection(factory.regularColumns.asSet(), 
values.keySet()))
-            write.put(col, eval(values.get(col)));
-        partition.setColumns(key(insert.values, factory.clusteringColumns),
-                             write,
-                             true);
+        BytesPartitionState finalPartition = partition;
+        var cd = key(insert.values, factory.clusteringColumns);
+        maybeUpdateColumns(Sets.intersection(factory.regularColumns.asSet(), 
values.keySet()),
+                           partition.get(cd),
+                           nowTs, values,
+                           (ts, write) -> finalPartition.setColumns(cd, ts, 
write, true));
     }
 
     private void update(Mutation.Update update)
     {
+        long nowTs = update.timestampOrDefault(numMutations);

Review Comment:
   So this timestamp won't match the one used in the actual data since Paxos 
doesn't allow `USING TIMESTAMP`? At least I think it doesn't.



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