yifan-c commented on code in PR #4431:
URL: https://github.com/apache/cassandra/pull/4431#discussion_r2605501477
##########
test/unit/org/apache/cassandra/db/marshal/AbstractTypeTest.java:
##########
@@ -960,17 +960,31 @@ public void testAssumedCompatibility()
@Test
public void testBackwardCompatibility()
{
+ // Fix for CASSANDRA-20979 altered behaviour of SimpleDateType and
TimeType by correctly
+ // returning the fix-length size in valueLengthIfFixed(). This change
impacted logic of
+ // isSerializationCompatibleWith(), which as a result complains about
backward compatibility of:
+ // 1) [SimpleDateType isSerializationCompatibleWith Int32Type, {}]
expected:<[fals]e> but was:<[tru]e>
+ // 2) [TimeType isSerializationCompatibleWith LongType, {}]
expected:<[fals]e> but was:<[tru]e>
+ // 3) [BytesType isSerializationCompatibleWith SimpleDateType, {}]
expected:<[tru]e> but was:<[fals]e>
+ // 4) [BytesType isSerializationCompatibleWith TimeType, {}]
expected:<[tru]e> but was:<[fals]e>
+ ImmutableMap<AbstractType, Set<AbstractType>> exclusions =
ImmutableMap.<AbstractType, Set<AbstractType>>builder()
+
.put(SimpleDateType.instance, ImmutableSet.of(Int32Type.instance))
+
.put(TimeType.instance, ImmutableSet.of(LongType.instance))
+
.put(BytesType.instance, ImmutableSet.of(SimpleDateType.instance,
TimeType.instance))
+
.build();
+
Review Comment:
I see. In trunk (13a3ae92976ae0724b0d20cca12b80c0174fb4f7),
`org.apache.cassandra.db.marshal.TimeType#valueLengthIfFixed` returns `-1` but
`org.apache.cassandra.cql3.functions.types.TypeCodec.TimeCodec#serializedSize`
return `8`.
`org.apache.cassandra.db.marshal.SimpleDateType#valueLengthIfFixed` returns
`-1` and
`org.apache.cassandra.cql3.functions.types.TypeCodec.DateCodec#serializedSize`
returns `8`.
--
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]