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


##########
src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java:
##########
@@ -815,16 +817,37 @@ final void addUpdates(UpdatesCollector collector,
                 }
                 else
                 {
+                    // Clustering keys need to be checked on their own
                     for (Clustering<?> clustering : clusterings)
                     {
                         clustering.validate();
+                        checkClusteringConstraints(clustering);
                         addUpdateForKey(updateBuilder, clustering, params);
                     }
                 }
             }
         }
     }
 
+    private void checkClusteringConstraints(Clustering<?> clustering)

Review Comment:
   What about this?
   
   ````
       private void checkClusteringConstraints(Clustering<?> clustering)
       {
           for (ColumnMetadata column : metadata.clusteringColumns())
           {
               if (column.hasConstraint())
               {
                   try
                   {
                       clustering.checkConstraints(column.position(), 
metadata.comparator, column.getColumnConstraints());
                   }
                   catch (ConstraintViolationException e)
                   {
                       throw new InvalidRequestException(e.getMessage(), e);
                   }
               }
           }
       }
   ````



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