advancedxy commented on code in PR #10755: URL: https://github.com/apache/iceberg/pull/10755#discussion_r1689817577
########## core/src/main/java/org/apache/iceberg/TableMetadata.java: ########## @@ -597,6 +597,24 @@ public TableMetadata replaceProperties(Map<String, String> rawProperties) { .build(); } + /** + * Prune the unused partition specs from the table metadata. + * + * <p>Note: it's not safe for external client to call this directly, it's usually called by the + * {@link Table#removeUnusedSpecs()} method. It's caller's responsibility to ensure that the + * toRemoveSpecs are indeed not in use by any existing manifests. + * + * @param toRemoveSpecs the partition specs to be removed + * @return the new table metadata with the unused partition specs removed + */ + TableMetadata pruneUnusedSpecs(List<PartitionSpec> toRemoveSpecs) { + Builder builder = new Builder(this); + for (PartitionSpec spec : toRemoveSpecs) { + builder.removePartitionSpec(spec); Review Comment: @amogh-jahagirdar I changed the implementation to `pruneUnusedSpecs` and `removePartitionSpec`. Please let me know what you think about this approach. -- 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