From 73e50fd8070c935764ea25b0f0302244bd2e52ef Mon Sep 17 00:00:00 2001 From: theoryxu Date: Mon, 30 Sep 2024 11:03:35 +0800 Subject: [PATCH] [#4370]feat(iceberg): support view interface for Iceberg REST server --- .../integration/test/IcebergRESTJdbcCatalogIT.java | 2 ++ .../integration/test/IcebergRESTServiceBaseIT.java | 2 +- .../integration/test/IcebergRESTServiceIT.java | 12 ++++++------ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/integration/test/IcebergRESTJdbcCatalogIT.java b/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/integration/test/IcebergRESTJdbcCatalogIT.java index 1dc758a15c3..d53f8022091 100644 --- a/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/integration/test/IcebergRESTJdbcCatalogIT.java +++ b/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/integration/test/IcebergRESTJdbcCatalogIT.java @@ -68,6 +68,8 @@ public Map getCatalogConfig() { configMap.put( IcebergConfig.ICEBERG_CONFIG_PREFIX + IcebergConfig.JDBC_INIT_TABLES.getKey(), "true"); + configMap.put(IcebergConfig.ICEBERG_CONFIG_PREFIX + "jdbc.schema-version", "V1"); + configMap.put( IcebergConfig.ICEBERG_CONFIG_PREFIX + IcebergConfig.CATALOG_WAREHOUSE.getKey(), GravitinoITUtils.genRandomName( diff --git a/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/integration/test/IcebergRESTServiceBaseIT.java b/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/integration/test/IcebergRESTServiceBaseIT.java index ce79997d4ff..0ba781cabd8 100644 --- a/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/integration/test/IcebergRESTServiceBaseIT.java +++ b/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/integration/test/IcebergRESTServiceBaseIT.java @@ -76,7 +76,7 @@ boolean catalogTypeNotMemory() { return !catalogType.equals(IcebergCatalogBackend.MEMORY); } - boolean catalogTypeNotHive() { + boolean isSupportsViewCatalog() { return !catalogType.equals(IcebergCatalogBackend.HIVE); } 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.java index 822ee7064f8..9b4900f4d75 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 @@ -560,7 +560,7 @@ void testRegisterTable() { } @Test - @EnabledIf("catalogTypeNotHive") + @EnabledIf("isSupportsViewCatalog") void testCreateViewAndDisplayView() { String originTableName = "iceberg_rest_table_test.create_table_for_view_1"; String viewName = "iceberg_rest_table_test.test_create_view"; @@ -582,7 +582,7 @@ void testCreateViewAndDisplayView() { } @Test - @EnabledIf("catalogTypeNotHive") + @EnabledIf("isSupportsViewCatalog") void testViewProperties() { String originTableName = "iceberg_rest_table_test.create_table_for_view_2"; String viewName = "iceberg_rest_table_test.test_create_view_with_properties"; @@ -622,7 +622,7 @@ void testViewProperties() { } @Test - @EnabledIf("catalogTypeNotHive") + @EnabledIf("isSupportsViewCatalog") void testDropView() { String originTableName = "iceberg_rest_table_test.create_table_for_view_3"; String viewName = "iceberg_rest_table_test.test_drop_view"; @@ -640,7 +640,7 @@ void testDropView() { } @Test - @EnabledIf("catalogTypeNotHive") + @EnabledIf("isSupportsViewCatalog") void testReplaceView() { String originTableName = "iceberg_rest_table_test.create_table_for_view_4"; String viewName = "iceberg_rest_table_test.test_replace_view"; @@ -662,7 +662,7 @@ void testReplaceView() { } @Test - @EnabledIf("catalogTypeNotHive") + @EnabledIf("isSupportsViewCatalog") void testShowAvailableViews() { String originTableName = "iceberg_rest_table_test.create_table_for_view_5"; String viewName1 = "iceberg_rest_table_test.show_available_views_1"; @@ -680,7 +680,7 @@ void testShowAvailableViews() { } @Test - @EnabledIf("catalogTypeNotHive") + @EnabledIf("isSupportsViewCatalog") void testShowCreateStatementView() { String originTableName = "iceberg_rest_table_test.create_table_for_view_6"; String viewName = "iceberg_rest_table_test.show_create_statement_view";