Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,7 @@ private Table createHiveTable(
checkArgument(Options.fromMap(options).get(TYPE) != FORMAT_TABLE);

Map<String, String> tblProperties;
if (syncAllProperties()) {
if (syncAllProperties(options)) {
tblProperties = new HashMap<>(options);
// add primary-key, partition-key to tblproperties
tblProperties.putAll(convertToPropertiesTableKey(tableSchema));
Expand Down Expand Up @@ -1210,8 +1210,10 @@ protected boolean allowCustomTablePath() {
return true;
}

public boolean syncAllProperties() {
return catalogOptions.get(SYNC_ALL_PROPERTIES);
public boolean syncAllProperties(Map<String, String> tableOptions) {
Map<String, String> merged = new HashMap<>(catalogOptions.toMap());
merged.putAll(tableOptions);
return new Options(merged).get(SYNC_ALL_PROPERTIES);
}

@Override
Expand Down Expand Up @@ -1570,12 +1572,12 @@ private void updateHmsTable(
}

private void updateHmsTablePars(Table table, TableSchema schema, Set<String> removedOptions) {
if (syncAllProperties()) {
table.getParameters().putAll(schema.options());
Map<String, String> 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);
}
Expand Down
Loading