smiklosovic commented on code in PR #3562:
URL: https://github.com/apache/cassandra/pull/3562#discussion_r1916365804
##########
src/java/org/apache/cassandra/cql3/Validation.java:
##########
@@ -64,4 +67,20 @@ public static void validateKey(TableMetadata metadata,
ByteBuffer key)
throw new InvalidRequestException(e.getMessage());
}
}
+
+ public static void checkConstraints(TableMetadata metadata, ByteBuffer key)
+ {
+ List<ColumnConstraint> partitionKeyConstraints =
metadata.partitionKeyConstraints;
Review Comment:
Actually, it is not necessary to resolve this every time. You can just do
````
try
{
metadata.partitionKeyType.checkConstraints(key,
metadata.partitionKeyConstraints);
}
catch (ConstraintViolationException e)
{
throw new InvalidRequestException(e.getMessage(), e);
}
````
Because `checkConstraints` is again checking if it is empty. You are
basically checking if it is empty twice.
--
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]