You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "danny0405 (via GitHub)" <gi...@apache.org> on 2023/07/07 06:09:04 UTC
[GitHub] [hudi] danny0405 commented on a diff in pull request #9133: [HUDI-6474] Added support for reading tables evolved using comprehensive schema e…
danny0405 commented on code in PR #9133:
URL: https://github.com/apache/hudi/pull/9133#discussion_r1255288699
##########
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:
Do not throws `RuntimeException` in nested calling code path, it is very obstacle for the invoker to get the perception. Either throws a checked exception or return null as of before.
--
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org