the-other-tim-brown commented on code in PR #13699:
URL: https://github.com/apache/hudi/pull/13699#discussion_r2275047264
##########
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:
If the internal schema has less fields than the requested schema. In the
writer path, the writer schema can have new columns that are not in the in
file's existing schema.
--
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]