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..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()) { + 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() { - return catalogOptions.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 @@ -1570,12 +1572,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(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); }