amogh-jahagirdar commented on code in PR #10352: URL: https://github.com/apache/iceberg/pull/10352#discussion_r1605820719
########## core/src/main/java/org/apache/iceberg/SchemaUpdate.java: ########## @@ -533,6 +537,34 @@ private static Schema applyChanges( } } + Map<Integer, List<Integer>> specToDeletes = Maps.newHashMap(); + if (base != null) { + for (int fieldIdToDelete : deletes) { + for (PartitionSpec spec : base.specs()) { + if (spec.schema().findField(fieldIdToDelete) != null) { + List<Integer> deletesForSpec = + specToDeletes.computeIfAbsent(spec.specId(), k -> Lists.newArrayList()); + deletesForSpec.add(fieldIdToDelete); + specToDeletes.put(spec.specId(), deletesForSpec); + } + } Review Comment: I think we only need to do this logic if the current snapshot is not null, so probably want to re-organize the logic around that. -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org