From 827cb70e1f75294708e124f006fbf8a37f7bd54e Mon Sep 17 00:00:00 2001 From: zouxxyy Date: Tue, 17 Dec 2024 16:48:13 +0800 Subject: [PATCH] 1 --- .../java/org/apache/paimon/catalog/AbstractCatalog.java | 6 ++++++ .../java/org/apache/paimon/catalog/FileSystemCatalog.java | 7 ------- .../src/main/java/org/apache/paimon/hive/HiveCatalog.java | 6 ------ .../test/java/org/apache/paimon/hive/HiveCatalogTest.java | 5 ++++- 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/paimon-core/src/main/java/org/apache/paimon/catalog/AbstractCatalog.java b/paimon-core/src/main/java/org/apache/paimon/catalog/AbstractCatalog.java index db6909295556..c4ee227da207 100644 --- a/paimon-core/src/main/java/org/apache/paimon/catalog/AbstractCatalog.java +++ b/paimon-core/src/main/java/org/apache/paimon/catalog/AbstractCatalog.java @@ -60,6 +60,7 @@ import static org.apache.paimon.CoreOptions.TYPE; import static org.apache.paimon.CoreOptions.createCommitUser; +import static org.apache.paimon.options.CatalogOptions.CASE_SENSITIVE; import static org.apache.paimon.options.CatalogOptions.LOCK_ENABLED; import static org.apache.paimon.options.CatalogOptions.LOCK_TYPE; import static org.apache.paimon.utils.BranchManager.DEFAULT_MAIN_BRANCH; @@ -114,6 +115,11 @@ public Optional defaultLockFactory() { return Optional.empty(); } + @Override + public boolean caseSensitive() { + return catalogOptions.get(CASE_SENSITIVE); + } + public Optional lockContext() { return Optional.of(CatalogLockContext.fromOptions(catalogOptions)); } diff --git a/paimon-core/src/main/java/org/apache/paimon/catalog/FileSystemCatalog.java b/paimon-core/src/main/java/org/apache/paimon/catalog/FileSystemCatalog.java index 3592b9837057..9d85012655a8 100644 --- a/paimon-core/src/main/java/org/apache/paimon/catalog/FileSystemCatalog.java +++ b/paimon-core/src/main/java/org/apache/paimon/catalog/FileSystemCatalog.java @@ -34,8 +34,6 @@ import java.util.Map; import java.util.concurrent.Callable; -import static org.apache.paimon.options.CatalogOptions.CASE_SENSITIVE; - /** A catalog implementation for {@link FileIO}. */ public class FileSystemCatalog extends AbstractCatalog { @@ -156,9 +154,4 @@ public void close() throws Exception {} public String warehouse() { return warehouse.toString(); } - - @Override - public boolean caseSensitive() { - return catalogOptions.get(CASE_SENSITIVE); - } } diff --git a/paimon-hive/paimon-hive-catalog/src/main/java/org/apache/paimon/hive/HiveCatalog.java b/paimon-hive/paimon-hive-catalog/src/main/java/org/apache/paimon/hive/HiveCatalog.java index 1008ada429d5..744f01d0a62f 100644 --- a/paimon-hive/paimon-hive-catalog/src/main/java/org/apache/paimon/hive/HiveCatalog.java +++ b/paimon-hive/paimon-hive-catalog/src/main/java/org/apache/paimon/hive/HiveCatalog.java @@ -103,7 +103,6 @@ import static org.apache.paimon.hive.HiveCatalogOptions.IDENTIFIER; import static org.apache.paimon.hive.HiveCatalogOptions.LOCATION_IN_PROPERTIES; import static org.apache.paimon.hive.HiveTableUtils.convertToFormatTable; -import static org.apache.paimon.options.CatalogOptions.CASE_SENSITIVE; import static org.apache.paimon.options.CatalogOptions.FORMAT_TABLE_ENABLED; import static org.apache.paimon.options.CatalogOptions.SYNC_ALL_PROPERTIES; import static org.apache.paimon.options.CatalogOptions.TABLE_TYPE; @@ -871,11 +870,6 @@ private void alterTableToHms(Table table, Identifier identifier, TableSchema new clients.execute(client -> HiveAlterTableUtils.alterTable(client, identifier, table)); } - @Override - public boolean caseSensitive() { - return catalogOptions.get(CASE_SENSITIVE); - } - @Override protected boolean allowCustomTablePath() { return true; diff --git a/paimon-hive/paimon-hive-catalog/src/test/java/org/apache/paimon/hive/HiveCatalogTest.java b/paimon-hive/paimon-hive-catalog/src/test/java/org/apache/paimon/hive/HiveCatalogTest.java index 267bdf0c7100..d7f276beac46 100644 --- a/paimon-hive/paimon-hive-catalog/src/test/java/org/apache/paimon/hive/HiveCatalogTest.java +++ b/paimon-hive/paimon-hive-catalog/src/test/java/org/apache/paimon/hive/HiveCatalogTest.java @@ -71,7 +71,10 @@ public void setUp() throws Exception { String jdoConnectionURL = "jdbc:derby:memory:" + UUID.randomUUID(); hiveConf.setVar(METASTORECONNECTURLKEY, jdoConnectionURL + ";create=true"); String metastoreClientClass = "org.apache.hadoop.hive.metastore.HiveMetaStoreClient"; - catalog = new HiveCatalog(fileIO, hiveConf, metastoreClientClass, warehouse); + Options catalogOptions = new Options(); + catalogOptions.set(CatalogOptions.CASE_SENSITIVE, false); + catalog = + new HiveCatalog(fileIO, hiveConf, metastoreClientClass, catalogOptions, warehouse); } @Test