dcapwell commented on code in PR #2723:
URL: https://github.com/apache/cassandra/pull/2723#discussion_r1336161232


##########
src/java/org/apache/cassandra/db/marshal/VectorType.java:
##########
@@ -629,8 +621,6 @@ public <V> List<T> deserialize(V input, ValueAccessor<V> 
accessor)
         @Override
         public <V> void validate(V input, ValueAccessor<V> accessor) throws 
MarshalException
         {
-            if (accessor.isEmpty(input))

Review Comment:
   don't we need to reject this case?



##########
src/java/org/apache/cassandra/db/marshal/VectorType.java:
##########
@@ -457,8 +460,6 @@ public <V> V serializeRaw(List<V> value, ValueAccessor<V> 
accessor)
         @Override
         public ByteBuffer serialize(List<T> value)
         {
-            if (value == null)

Review Comment:
   don't we need to reject this case?



##########
src/java/org/apache/cassandra/db/marshal/VectorType.java:
##########
@@ -174,8 +176,6 @@ public <V> V decomposeAsFloat(ValueAccessor<V> accessor, 
float[] value)
     {
         if (!(elementType instanceof FloatType))
             throw new IllegalStateException("Attempted to read as float, but 
element type is " + elementType.asCQL3Type());
-        if (value == null)

Review Comment:
   if this happens we NPE, so should we throw an error with a useful msg if we 
don't want to return `null`?
   
   This change is also not consistent with `fromComparableBytes`



##########
src/java/org/apache/cassandra/db/marshal/VectorType.java:
##########
@@ -442,8 +447,6 @@ public <V> List<V> split(V buffer, ValueAccessor<V> 
accessor)
         @Override
         public <V> V serializeRaw(List<V> value, ValueAccessor<V> accessor)
         {
-            if (value == null)

Review Comment:
   don't we need to reject this case?



##########
src/java/org/apache/cassandra/db/marshal/VectorType.java:
##########
@@ -491,8 +492,6 @@ public <V> List<T> deserialize(V input, ValueAccessor<V> 
accessor)
         @Override
         public <V> void validate(V input, ValueAccessor<V> accessor) throws 
MarshalException
         {
-            if (accessor.isEmpty(input))

Review Comment:
   don't we need to reject this case?



##########
src/java/org/apache/cassandra/db/marshal/VectorType.java:
##########
@@ -583,8 +579,6 @@ public <V> List<V> split(V buffer, ValueAccessor<V> 
accessor)
         @Override
         public <V> V serializeRaw(List<V> value, ValueAccessor<V> accessor)
         {
-            if (value == null)

Review Comment:
   don't we need to reject this case?



##########
src/java/org/apache/cassandra/db/marshal/VectorType.java:
##########
@@ -597,8 +591,6 @@ public <V> V serializeRaw(List<V> value, ValueAccessor<V> 
accessor)
         @Override
         public ByteBuffer serialize(List<T> value)
         {
-            if (value == null)

Review Comment:
   don't we need to reject this case?



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