yihua commented on code in PR #5427:
URL: https://github.com/apache/hudi/pull/5427#discussion_r858155285
##########
hudi-common/src/main/java/org/apache/hudi/internal/schema/utils/InternalSchemaUtils.java:
##########
@@ -54,13 +58,16 @@ private InternalSchemaUtils() {
*/
public static InternalSchema pruneInternalSchema(InternalSchema schema,
List<String> names) {
// do check
- 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 not exisit in hudi table", name));
- }
- return id;
- }).collect(Collectors.toList());
+ List<Integer> prunedIds = names.stream()
+ .filter(name -> {
+ int id = schema.findIdByName(name);
Review Comment:
Actually, the filtering should not happen after a second thought. I'm going
to rethink how to make the fix.
--
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]