Skip to content

World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.

[#547] fix(lakehouse-iceberg): purge table may hang in Iceberg REST server IT with hdfs configurations (#916)

FANNG4fadc821e6e9
diff --git a/integration-test/src/test/java/com/datastrato/gravitino/integration/test/catalog/lakehouse/iceberg/IcebergRESTServiceBaseIT.java b/integration-test/src/test/java/com/datastrato/gravitino/integration/test/catalog/lakehouse/iceberg/IcebergRESTServiceBaseIT.java
index 50142a8ea7..e000ba8083 100644
--- a/integration-test/src/test/java/com/datastrato/gravitino/integration/test/catalog/lakehouse/iceberg/IcebergRESTServiceBaseIT.java
+++ b/integration-test/src/test/java/com/datastrato/gravitino/integration/test/catalog/lakehouse/iceberg/IcebergRESTServiceBaseIT.java
@@ -222,6 +222,8 @@ public class IcebergRESTServiceBaseIT extends AbstractIT {
.config("spark.sql.catalog.rest", "org.apache.iceberg.spark.SparkCatalog")
.config("spark.sql.catalog.rest.type", "rest")
.config("spark.sql.catalog.rest.uri", IcebergRESTUri)
+ // drop Iceberg table purge may hang in spark local mode
+ .config("spark.locality.wait.node", "0")
.getOrCreate();
}
diff --git a/integration-test/src/test/java/com/datastrato/gravitino/integration/test/catalog/lakehouse/iceberg/IcebergRESTServiceIT.java b/integration-test/src/test/java/com/datastrato/gravitino/integration/test/catalog/lakehouse/iceberg/IcebergRESTServiceIT.java
index 6a0567cbd5..310ef83c48 100644
--- a/integration-test/src/test/java/com/datastrato/gravitino/integration/test/catalog/lakehouse/iceberg/IcebergRESTServiceIT.java
+++ b/integration-test/src/test/java/com/datastrato/gravitino/integration/test/catalog/lakehouse/iceberg/IcebergRESTServiceIT.java
@@ -48,15 +48,13 @@ public class IcebergRESTServiceIT extends IcebergRESTServiceBaseIT {
purgeAllIcebergTestNamespaces();
}
- // Spark purge Iceberg table may hang, so use drop table instead
- // https://github.com/datastrato/gravitino/issues/547 tracks purge table issue
- private void dropTable(String namespace, String table) {
- sql(String.format("DROP TABLE %s.%s", namespace, table));
+ private void purgeTable(String namespace, String table) {
+ sql(String.format("DROP TABLE %s.%s PURGE", namespace, table));
}
private void purgeNameSpace(String namespace) {
Set<String> tables = convertToStringSet(sql("SHOW TABLES IN " + namespace), 1);
- tables.forEach(table -> dropTable(namespace, table));
+ tables.forEach(table -> purgeTable(namespace, table));
sql("DROP database " + namespace);
}