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


##########
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:
   Yes and we shouldn't do this in `isValueCompatibleWithInternal` since it 
will prevent CASTing to bytes.



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