driftx commented on code in PR #4439:
URL: https://github.com/apache/cassandra/pull/4439#discussion_r2466825484


##########
src/java/org/apache/cassandra/db/marshal/BytesType.java:
##########
@@ -90,8 +90,9 @@ public boolean isCompatibleWith(AbstractType<?> previous)
     @Override
     public boolean isValueCompatibleWithInternal(AbstractType<?> otherType)
     {
-        // BytesType can read anything
-        return true;
+        // BytesType should only be compatible with simple scalar types, not 
with collections or UDTs
+        // because converting a collection or UDT to raw bytes is nonsensical
+        return !otherType.isMultiCell();

Review Comment:
   Doing this here will break cql CAST operations, which I think we still might 
want to allow since they are explicit, and different from finding a column you 
re-added contains junk bytes.
   
   Also, `isMultiCell` will return false for frozen collections.



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