smiklosovic commented on code in PR #3562:
URL: https://github.com/apache/cassandra/pull/3562#discussion_r1916579161


##########
src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java:
##########
@@ -348,4 +366,34 @@ public AuditLogContext getAuditLogContext()
     {
         return new AuditLogContext(AuditLogEntryType.UPDATE, keyspace(), 
table());
     }
+
+    public static void evaluateConstraintsForRow(Row row)
+    {
+        Iterator<Cell<?>> cellIt = row.cells().iterator();
+        // check constraint for each column
+        while (cellIt.hasNext())
+        {
+            Cell<?> cell = cellIt.next();
+            ColumnMetadata columnMetadata = cell.column();
+            if (!columnMetadata.hasConstraint()
+                || columnMetadata.isComplex()) // complex column is not 
supported, for now
+                continue;
+
+            ByteBuffer cellData = cell.buffer();
+            evaluateConstraint(columnMetadata, cellData);
+        }
+    }
+
+    public static void evaluateConstraint(ColumnMetadata columnMetadata, 
ByteBuffer cellData)
+    {
+        if (columnMetadata.hasConstraint())

Review Comment:
   @bbotella you are checking it unnecessarily again, of course it has 
constraints because otherwise you would hit `continue` in 
`evaluateConstraintsForRow`. Also, this method does not seem to be used 
anywhere else but here.



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

Reply via email to