the-other-tim-brown commented on code in PR #13699:
URL: https://github.com/apache/hudi/pull/13699#discussion_r2275104323


##########
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:
   It looks like we get around this in the current flows by using 
`AvroSchemaEvolutionUtils.reconcileSchema` before setting the `InternalSchema`. 
I will test this out with the schema evolution cases.



-- 
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]

Reply via email to