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


##########
src/java/org/apache/cassandra/cql3/constraints/LengthConstraint.java:
##########
@@ -56,35 +58,12 @@ public void evaluate(Class<? extends AbstractType> 
valueType, Operator relationT
         int valueLength = getValueSize(columnValue, valueType);
         int sizeConstraint = Integer.parseInt(term);
 
-        switch (relationType)
-        {
-            case EQ:
-                if (valueLength != sizeConstraint)
-                    throw new ConstraintViolationException(columnName + " 
value length should be exactly " + sizeConstraint);
-                break;
-            case NEQ:
-                if (valueLength == sizeConstraint)
-                    throw new ConstraintViolationException(columnName + " 
value length should be different from " + sizeConstraint);
-                break;
-            case GT:
-                if (valueLength <= sizeConstraint)
-                    throw new ConstraintViolationException(columnName + " 
value length should be larger than " + sizeConstraint);
-                break;
-            case LT:
-                if (valueLength >= sizeConstraint)
-                    throw new ConstraintViolationException(columnName + " 
value length should be smaller than " + sizeConstraint);
-                break;
-            case GTE:
-                if (valueLength < sizeConstraint)
-                    throw new ConstraintViolationException(columnName + " 
value length should be larger or equal than " + sizeConstraint);
-                break;
-            case LTE:
-                if (valueLength > sizeConstraint)
-                    throw new ConstraintViolationException(columnName + " 
value length should be smaller or equala than " + sizeConstraint);
-                break;
-            default:
-                throw new ConstraintViolationException("Invalid relation type: 
" + relationType);
-        }
+        ByteBuffer  buffera = ByteBufferUtil.bytes(valueLength);

Review Comment:
   nit: there are two spaces instead of one, same one line below.



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