amogh-jahagirdar commented on code in PR #10755: URL: https://github.com/apache/iceberg/pull/10755#discussion_r1829925773
########## api/src/main/java/org/apache/iceberg/ExpireSnapshots.java: ########## @@ -118,4 +118,16 @@ public interface ExpireSnapshots extends PendingUpdate<List<Snapshot>> { * @return this for method chaining */ ExpireSnapshots cleanExpiredFiles(boolean clean); + + /** + * Allows removal of unreachable partition specs as part of the expiration operation + * + * @param removeUnusedSpecs setting this to true will remove partition specs that are no longer + * reachable by any snapshot + * @return this for method chaining + */ + default ExpireSnapshots removeUnusedSpecs(boolean removeUnusedSpecs) { Review Comment: @RussellSpitzer I was thinking about not exposing the API at all and doing the cleanup by default in the implementation since it's true that there's no real benefit to keeping the spec/schema in place. The rationale for having the API is more REST + compatibility related. A bit ago, we added the ability to send remove spec updates to the server and if we change the snapshot expiration implementation to just always remove metadata in the implementation, servers may not be able to handle that yet since it was recently added as a possible update type and services would perhaps unnecessarily fail the commit as part of expiration since the service would say spec removal is unsupported. In the current model a client would opt-in knowing that the service would support the spec removal. There may be a different way to handle this though so we can keep it all implicit in the procedure though. -- 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