Skip to content

Commit 82798cf

Browse files
committed
Don't pass expected_parameter_key/value with Hive Locking enabled
1 parent 0a39998 commit 82798cf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/hms/HiveMetastoreTableOperations.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,13 @@ private void commitTableUpdate(Table table, TableMetadata metadata, BiFunction<T
113113

114114
Table updatedTable = tableUpdateFunction.apply(table, newMetadataLocation);
115115

116+
// it's redundant to pass metadata_location to environmentContext if Hive locking is enabled
117+
Map<String, String> environmentContext = lockingEnabled ? ImmutableMap.of() : environmentContext(metadataLocation);
118+
116119
// todo privileges should not be replaced for an alter
117120
PrincipalPrivileges privileges = table.getOwner().map(MetastoreUtil::buildInitialPrivilegeSet).orElse(NO_PRIVILEGES);
118121
try {
119-
metastore.replaceTable(table.getDatabaseName(), table.getTableName(), updatedTable, privileges, environmentContext(metadataLocation));
122+
metastore.replaceTable(table.getDatabaseName(), table.getTableName(), updatedTable, privileges, environmentContext);
120123
}
121124
catch (RuntimeException e) {
122125
// Cannot determine whether the `replaceTable` operation was successful,

0 commit comments

Comments
 (0)