From 25e068293f9fe5520f919f10a56ce9f3eb540463 Mon Sep 17 00:00:00 2001 From: Askwang <135721692+Askwang@users.noreply.github.com> Date: Wed, 17 Sep 2025 10:12:48 +0800 Subject: [PATCH 1/2] 1 --- .../java/org/apache/paimon/hive/HiveCatalog.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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 6e3bf4782cf0..fcffa0e66744 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 @@ -1054,7 +1054,7 @@ private Table createHiveTable( checkArgument(Options.fromMap(options).get(TYPE) != FORMAT_TABLE); Map tblProperties; - if (syncAllProperties()) { + if (syncAllProperties(new Options(options))) { tblProperties = new HashMap<>(options); // add primary-key, partition-key to tblproperties tblProperties.putAll(convertToPropertiesTableKey(tableSchema)); @@ -1210,8 +1210,8 @@ protected boolean allowCustomTablePath() { return true; } - public boolean syncAllProperties() { - return catalogOptions.get(SYNC_ALL_PROPERTIES); + public boolean syncAllProperties(Options tableOptions) { + return tableOptions.get(SYNC_ALL_PROPERTIES); } @Override @@ -1570,12 +1570,12 @@ private void updateHmsTable( } private void updateHmsTablePars(Table table, TableSchema schema, Set removedOptions) { - if (syncAllProperties()) { - table.getParameters().putAll(schema.options()); + Map options = schema.options(); + if (syncAllProperties(new Options(options))) { + table.getParameters().putAll(options); table.getParameters().putAll(convertToPropertiesTableKey(schema)); } else { - table.getParameters() - .putAll(convertToPropertiesPrefixKey(schema.options(), HIVE_PREFIX)); + table.getParameters().putAll(convertToPropertiesPrefixKey(options, HIVE_PREFIX)); } removedOptions.forEach(table.getParameters()::remove); } From d8889d28ad2a49c3e6e51508aebf03a097c11409 Mon Sep 17 00:00:00 2001 From: Askwang <135721692+Askwang@users.noreply.github.com> Date: Wed, 17 Sep 2025 11:03:49 +0800 Subject: [PATCH 2/2] fix --- .../main/java/org/apache/paimon/hive/HiveCatalog.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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 fcffa0e66744..43310430f16a 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 @@ -1054,7 +1054,7 @@ private Table createHiveTable( checkArgument(Options.fromMap(options).get(TYPE) != FORMAT_TABLE); Map tblProperties; - if (syncAllProperties(new Options(options))) { + if (syncAllProperties(options)) { tblProperties = new HashMap<>(options); // add primary-key, partition-key to tblproperties tblProperties.putAll(convertToPropertiesTableKey(tableSchema)); @@ -1210,8 +1210,10 @@ protected boolean allowCustomTablePath() { return true; } - public boolean syncAllProperties(Options tableOptions) { - return tableOptions.get(SYNC_ALL_PROPERTIES); + public boolean syncAllProperties(Map tableOptions) { + Map merged = new HashMap<>(catalogOptions.toMap()); + merged.putAll(tableOptions); + return new Options(merged).get(SYNC_ALL_PROPERTIES); } @Override @@ -1571,7 +1573,7 @@ private void updateHmsTable( private void updateHmsTablePars(Table table, TableSchema schema, Set removedOptions) { Map options = schema.options(); - if (syncAllProperties(new Options(options))) { + if (syncAllProperties(options)) { table.getParameters().putAll(options); table.getParameters().putAll(convertToPropertiesTableKey(schema)); } else {