World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.
Java ai-catalogdata-catalogdatalakefederated-querylakehousemetadatametalakemodel-catalogopendatacatalogskycomputingstratosphere
[#9989] improvement(iceberg) upgrade iceberg to 1.10.1 (#9972)
Xinyi Lub34f4b48c8ac
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.tomlindex d013347d58..429a8fbdcf 100644--- a/gradle/libs.versions.toml+++ b/gradle/libs.versions.toml@@ -60,7 +60,7 @@ commons-collections3 = "3.2.2"commons-configuration1 = "1.6"commons-dbcp2 = "2.11.0"caffeine = "2.9.3"-iceberg = '1.10.0' # used for Gravitino Iceberg catalog and Iceberg REST service+iceberg = '1.10.1' # used for Gravitino Iceberg catalog and Iceberg REST serviceiceberg4connector = "1.6.1" # used for compile connectors like Spark, Flink, etcpaimon = '1.2.0'spark33 = "3.3.4"diff --git a/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/integration/test/IcebergRESTServiceIT.java b/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/integration/test/IcebergRESTServiceIT.javaindex b7e95b7937..51aca2dc02 100644--- a/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/integration/test/IcebergRESTServiceIT.java+++ b/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/integration/test/IcebergRESTServiceIT.java@@ -117,6 +117,10 @@ public abstract class IcebergRESTServiceIT extends IcebergRESTServiceBaseIT {sql(String.format("DROP TABLE %s.%s PURGE", namespace, table));}+ private void purgeView(String namespace, String view) {+ sql(String.format("DROP VIEW %s.%s", namespace, view));+ }+private void purgeNamespace(String namespace) {if (!namespaceExists(namespace)) {return;@@ -129,6 +133,15 @@ public abstract class IcebergRESTServiceIT extends IcebergRESTServiceBaseIT {childNamespacesString.forEach(this::purgeNamespace);}+ // Drop views first (required by Iceberg 1.10.1+)+ try {+ List<Object[]> views = sql("SHOW VIEWS IN " + namespace);+ Set<String> viewsString = convertToStringSet(views, 1);+ viewsString.forEach(view -> purgeView(namespace, view));+ } catch (Exception e) {+ // Ignore if SHOW VIEWS is not supported+ }+Set<String> tables = convertToStringSet(sql("SHOW TABLES IN " + namespace), 1);tables.forEach(table -> purgeTable(namespace, table));sql("DROP database " + namespace);diff --git a/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/service/rest/TestIcebergTableOperations.java b/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/service/rest/TestIcebergTableOperations.javaindex de4cfc7e19..f4a9a2b602 100644--- a/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/service/rest/TestIcebergTableOperations.java+++ b/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/service/rest/TestIcebergTableOperations.java@@ -176,8 +176,7 @@ public class TestIcebergTableOperations extends IcebergNamespaceTestBase {metadata.currentSnapshot() == null ? null : metadata.currentSnapshot().snapshotId();JsonNode planResponse = verifyPlanTableScanSucc(namespace, "plan_scan_table", snapshotId);- Assertions.assertEquals(- PlanStatus.COMPLETED.status(), planResponse.get("plan-status").asText());+ Assertions.assertEquals(PlanStatus.COMPLETED.status(), planResponse.get("status").asText());Assertions.assertTrue(planResponse.has("plan-tasks"));Assertions.assertTrue(planResponse.get("plan-tasks").isArray());Assertions.assertTrue(planResponse.get("plan-tasks").size() > 0);@@ -223,8 +222,7 @@ public class TestIcebergTableOperations extends IcebergNamespaceTestBase {JsonNode planResponse =verifyPlanTableScanSuccWithRange(namespace, "incremental_scan_valid_table", startSnapshotId, endSnapshotId);- Assertions.assertEquals(- PlanStatus.COMPLETED.status(), planResponse.get("plan-status").asText());+ Assertions.assertEquals(PlanStatus.COMPLETED.status(), planResponse.get("status").asText());Assertions.assertTrue(planResponse.has("plan-tasks"));Assertions.assertTrue(planResponse.get("plan-tasks").isArray());@@ -573,7 +571,7 @@ public class TestIcebergTableOperations extends IcebergNamespaceTestBase {}private PlanTableScanRequest buildPlanTableScanRequest(Long snapshotId) {- PlanTableScanRequest.Builder builder = new PlanTableScanRequest.Builder();+ PlanTableScanRequest.Builder builder = PlanTableScanRequest.builder();if (snapshotId != null) {builder = builder.withSnapshotId(snapshotId);} else {@@ -584,7 +582,7 @@ public class TestIcebergTableOperations extends IcebergNamespaceTestBase {private PlanTableScanRequest buildPlanTableScanRequestWithRange(Long startSnapshotId, Long endSnapshotId) {- PlanTableScanRequest.Builder builder = new PlanTableScanRequest.Builder();+ PlanTableScanRequest.Builder builder = PlanTableScanRequest.builder();if (startSnapshotId != null) {builder = builder.withStartSnapshotId(startSnapshotId);}diff --git a/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/service/rest/TestScanPlanCache.java b/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/service/rest/TestScanPlanCache.javaindex cd4912c6cb..015f1ad9f1 100644--- a/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/service/rest/TestScanPlanCache.java+++ b/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/service/rest/TestScanPlanCache.java@@ -72,8 +72,7 @@ public class TestScanPlanCache {@Testpublic void testCacheHit() {- PlanTableScanRequest scanRequest =- new PlanTableScanRequest.Builder().withSnapshotId(1L).build();+ PlanTableScanRequest scanRequest = PlanTableScanRequest.builder().withSnapshotId(1L).build();PlanTableScanResponse response =PlanTableScanResponse.builder().withPlanStatus(PlanStatus.COMPLETED)@@ -95,9 +94,9 @@ public class TestScanPlanCache {@Testpublic void testCacheMiss() {- PlanTableScanRequest request1 = new PlanTableScanRequest.Builder().withSnapshotId(1L).build();+ PlanTableScanRequest request1 = PlanTableScanRequest.builder().withSnapshotId(1L).build();PlanTableScanRequest request2 =- new PlanTableScanRequest.Builder()+ PlanTableScanRequest.builder().withSelect(Arrays.asList("id", "name")).withSnapshotId(1L).build();@@ -133,12 +132,12 @@ public class TestScanPlanCache {@Testpublic void testCacheKeyWithDifferentSelectOrder() {PlanTableScanRequest request1 =- new PlanTableScanRequest.Builder()+ PlanTableScanRequest.builder().withSelect(Arrays.asList("id", "name")).withSnapshotId(1L).build();PlanTableScanRequest request2 =- new PlanTableScanRequest.Builder()+ PlanTableScanRequest.builder().withSelect(Arrays.asList("name", "id")).withSnapshotId(1L).build();@@ -163,8 +162,7 @@ public class TestScanPlanCache {TableIdentifier table1 = TableIdentifier.of(Namespace.of("db1"), "table1");TableIdentifier table2 = TableIdentifier.of(Namespace.of("db2"), "table2");- PlanTableScanRequest scanRequest =- new PlanTableScanRequest.Builder().withSnapshotId(1L).build();+ PlanTableScanRequest scanRequest = PlanTableScanRequest.builder().withSnapshotId(1L).build();PlanTableScanResponse response1 =PlanTableScanResponse.builder()@@ -195,8 +193,8 @@ public class TestScanPlanCache {@Testpublic void testCacheKeyWithDifferentSnapshotId() {- PlanTableScanRequest request1 = new PlanTableScanRequest.Builder().withSnapshotId(1L).build();- PlanTableScanRequest request2 = new PlanTableScanRequest.Builder().withSnapshotId(2L).build();+ PlanTableScanRequest request1 = PlanTableScanRequest.builder().withSnapshotId(1L).build();+ PlanTableScanRequest request2 = PlanTableScanRequest.builder().withSnapshotId(2L).build();PlanTableScanResponse response1 =PlanTableScanResponse.builder()@@ -229,9 +227,9 @@ public class TestScanPlanCache {// if they differ in other parameterswhen(mockTable.currentSnapshot()).thenReturn(null);- PlanTableScanRequest request1 = new PlanTableScanRequest.Builder().withSnapshotId(1L).build();+ PlanTableScanRequest request1 = PlanTableScanRequest.builder().withSnapshotId(1L).build();PlanTableScanRequest request2 =- new PlanTableScanRequest.Builder()+ PlanTableScanRequest.builder().withSnapshotId(1L).withSelect(Arrays.asList("id", "name")).build();@@ -281,9 +279,9 @@ public class TestScanPlanCache {"Standard isEquivalentTo() should return false for simple expression.");PlanTableScanRequest request1 =- new PlanTableScanRequest.Builder().withFilter(expr1).withSnapshotId(1L).build();+ PlanTableScanRequest.builder().withFilter(expr1).withSnapshotId(1L).build();PlanTableScanRequest request2 =- new PlanTableScanRequest.Builder().withFilter(expr2).withSnapshotId(1L).build();+ PlanTableScanRequest.builder().withFilter(expr2).withSnapshotId(1L).build();ScanPlanCacheKey key1 = ScanPlanCacheKey.create(tableIdentifier, mockTable, request1);ScanPlanCacheKey key2 = ScanPlanCacheKey.create(tableIdentifier, mockTable, request2);