danny0405 commented on code in PR #13699:
URL: https://github.com/apache/hudi/pull/13699#discussion_r2275033897
##########
hudi-common/src/main/java/org/apache/hudi/internal/schema/utils/InternalSchemaUtils.java:
##########
@@ -57,15 +62,16 @@ public static InternalSchema
pruneInternalSchema(InternalSchema schema, List<Str
List<Integer> prunedIds = names.stream().map(name -> {
int id = schema.findIdByName(name);
if (id == -1) {
- throw new IllegalArgumentException(String.format("cannot prune col: %s
which does not exist in hudi table", name));
+ LOG.debug("Cannot find field name {} in schema {}, skipping.", name,
schema);
+ return null;
}
return id;
- }).collect(Collectors.toList());
+ }).filter(Objects::nonNull).collect(Collectors.toList());
Review Comment:
> cannot prune col: %s which does not exist in hudi table
The original logic makes more sense, what is the use case that to prune the
schema with a non existing field?
--
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]