raminqaf commented on code in PR #29101:
URL: https://github.com/apache/flink/pull/29101#discussion_r3933501407
##########
flink-table/flink-table-common/src/test/java/org/apache/flink/table/types/LogicalTypeCastsTest.java:
##########
@@ -297,7 +298,31 @@ private static Stream<Arguments> testData() {
new VariantType(),
new MapType(new IntType(), new CharType()),
false,
- false));
+ false),
+ // UUID casts are explicit only, in both directions
+ Arguments.of(new UuidType(), VarCharType.STRING_TYPE, false,
true),
+ Arguments.of(new UuidType(), new CharType(), false, true),
+ Arguments.of(VarCharType.STRING_TYPE, new UuidType(), false,
true),
+ Arguments.of(new CharType(), new UuidType(), false, true),
+ // UUID maps to its 16-byte encoding: only BINARY(16) and
BYTES, any other width is
+ // rejected because it would pad or trim the value
+ Arguments.of(new UuidType(), new BinaryType(16), false, true),
+ Arguments.of(new UuidType(), new BinaryType(10), false, false),
+ Arguments.of(
+ new UuidType(), new
VarBinaryType(VarBinaryType.MAX_LENGTH), false, true),
+ Arguments.of(new UuidType(), new VarBinaryType(16), false,
false),
Review Comment:
Yes, it is indeed wrong. Updated it
--
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]