voonhous commented on code in PR #9133:
URL: https://github.com/apache/hudi/pull/9133#discussion_r1255387877
##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/table/format/CastMap.java:
##########
@@ -165,21 +192,132 @@ void add(int pos, LogicalType fromType, LogicalType
toType) {
}
break;
}
+ case ARRAY: {
+ if (from == ARRAY) {
+ LogicalType fromElementType = fromType.getChildren().get(0);
+ LogicalType toElementType = toType.getChildren().get(0);
+ return array -> doArrayConversion((ArrayData) array,
fromElementType, toElementType);
+ }
+ break;
+ }
+ case MAP: {
+ if (from == MAP) {
+ return map -> doMapConversion((MapData) map, fromType, toType);
+ }
+ break;
+ }
+ case ROW: {
+ if (from == ROW) {
+ // Assumption: InternalSchemaManager should produce a cast that is
of the same size
+ return row -> doRowConversion((RowData) row, fromType, toType);
+ }
+ break;
+ }
default:
}
- return null;
+ throw new IllegalArgumentException(String.format("Unsupported conversion
for %s => %s", fromType, toType));
Review Comment:
Modified them to be checked exceptions, not sure if i did it correctly,
please take a look, thank you.
--
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]