rdblue commented on a change in pull request #1796:
URL: https://github.com/apache/iceberg/pull/1796#discussion_r527936112



##########
File path: core/src/main/java/org/apache/iceberg/RemoveSnapshots.java
##########
@@ -78,6 +81,13 @@ public void accept(String file) {
   RemoveSnapshots(TableOperations ops) {
     this.ops = ops;
     this.base = ops.current();
+
+    ValidationException.check(
+        PropertyUtil.propertyAsBoolean(base.properties(), GC_ENABLED, 
GC_ENABLED_DEFAULT),
+        "Not allowed to expire snapshots as the garbage collection is disabled 
for this table. " +
+        "Make sure this table is the exclusive owner of its data files before 
allowing garbage collection. " +
+        "If the table was created using the SNAPSHOT operation, it is not safe 
to expire snapshots in it since " +
+        "this may remove files in the original table.");

Review comment:
       I think it is reasonable to allow people to update it. Having properties 
that can only be set by the library itself seems like we're asking for people 
to go edit files by hand when they have a need. That said, I think it would be 
fine to not suggest that this can be changed. If they want to track it down by 
going to the code and reading this check, then fine. But we can change this to 
"Cannot expire snapshots: GC is disabled (deleting files may corrupt other 
tables)"




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

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to