nastra commented on code in PR #8382:
URL: https://github.com/apache/iceberg/pull/8382#discussion_r1324729817


##########
nessie/src/main/java/org/apache/iceberg/nessie/NessieUtil.java:
##########
@@ -102,6 +102,38 @@ private static String commitAuthor(Map<String, String> 
catalogOptions) {
         .orElseGet(() -> System.getProperty("user.name"));
   }
 
+  private static void checkAndUpdateGCProperties(
+      TableMetadata tableMetadata, Map<String, String> updatedProperties, 
String identifier) {
+    if (tableMetadata.propertyAsBoolean(
+        NessieTableOperations.NESSIE_GC_NO_WARNING_PROPERTY, false)) {
+      return;
+    }
+
+    // To prevent accidental deletion of files that are still referenced by 
other branches/tags,
+    // setting GC_ENABLED to 'false' is recommended, so that all Iceberg's gc 
operations like
+    // expire_snapshots, remove_orphan_files, drop_table with purge will fail 
with an error.
+    // `nessie-gc` CLI provides a reference-aware GC functionality for the 
expired/unreferenced
+    // files.
+    // Advanced users may still want to use the simpler Iceberg GC tools iff 
their Nessie Server
+    // contains only one branch (in which case the full Nessie history will be 
reflected in the
+    // Iceberg sequence of snapshots).
+    if (tableMetadata.propertyAsBoolean(
+            TableProperties.GC_ENABLED, TableProperties.GC_ENABLED_DEFAULT)
+        || tableMetadata.propertyAsBoolean(
+            TableProperties.METADATA_DELETE_AFTER_COMMIT_ENABLED,
+            TableProperties.METADATA_DELETE_AFTER_COMMIT_ENABLED_DEFAULT)) {

Review Comment:
   it's up to you, I just wanted to point that out :)



-- 
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: [email protected]

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