amogh-jahagirdar commented on code in PR #10755:
URL: https://github.com/apache/iceberg/pull/10755#discussion_r1829690607


##########
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:
   Also, while I think we generally try and avoid boolean arguments in APIs, 
this may be one case where it makes sense. Down the line, if we want to make 
this behavior the default and have a path for users to disable cleanup of 
specs/schemas, they can. 



##########
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:
   Should we make this API a more generic `removeUnusedTableMetadata`? This 
goes back to the previous discussion that removing schemas and partition specs, 
requires the same level of work that the implementation has to do so imo 
there's not much value in separating them and forcing a user to chain multiple 
methods. Generally if they want to remove unused specs, they probably also want 
to remove unused schemas as well.



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

Reply via email to