dimas-b commented on code in PR #7641:
URL: https://github.com/apache/iceberg/pull/7641#discussion_r1197811718
##########
nessie/src/test/java/org/apache/iceberg/nessie/TestNessieTable.java:
##########
@@ -579,6 +584,44 @@ public void testGCEnabled() {
"Cannot expire snapshots: GC is disabled (deleting files may
corrupt other tables)");
}
+ @Test
+ public void testTableMetadataFilesCleanupDisable() {
+ Table icebergTable = catalog.loadTable(TABLE_IDENTIFIER);
+
+ Assertions.assertThat(
+
icebergTable.properties().get(TableProperties.METADATA_DELETE_AFTER_COMMIT_ENABLED))
+ .isNotNull()
+ .isEqualTo("false");
+
+ icebergTable
+ .updateProperties()
+ .set(TableProperties.METADATA_DELETE_AFTER_COMMIT_ENABLED, "true")
Review Comment:
Is this expected to be overridden back to `false` by the Nessie Catalog? If
so, shouldn't we assert that?
##########
nessie/src/test/java/org/apache/iceberg/nessie/TestNessieTable.java:
##########
@@ -579,6 +584,44 @@ public void testGCEnabled() {
"Cannot expire snapshots: GC is disabled (deleting files may
corrupt other tables)");
}
+ @Test
+ public void testTableMetadataFilesCleanupDisable() {
+ Table icebergTable = catalog.loadTable(TABLE_IDENTIFIER);
+
+ Assertions.assertThat(
+
icebergTable.properties().get(TableProperties.METADATA_DELETE_AFTER_COMMIT_ENABLED))
+ .isNotNull()
+ .isEqualTo("false");
+
+ icebergTable
+ .updateProperties()
+ .set(TableProperties.METADATA_DELETE_AFTER_COMMIT_ENABLED, "true")
+ .commit();
+ icebergTable
+ .updateProperties()
+ .set(TableProperties.METADATA_PREVIOUS_VERSIONS_MAX, "1")
+ .commit();
+
+ String metadataFileLocation =
+ ((BaseTable)
icebergTable).operations().current().metadataFileLocation();
+ Path metadataFileLocationPath =
Paths.get(metadataFileLocation.replaceFirst("file:", ""));
Review Comment:
Would it be more robust to parse `metadataFileLocation` as a URI, assert
schema value, and call `.getPath()`?
--
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]