Skip to content
Merged
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 @@ -113,10 +113,13 @@ private void commitTableUpdate(Table table, TableMetadata metadata, BiFunction<T

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

// Passing environment context causes redundant operations if Hive locking is enabled
Copy link
Contributor

@chenjian2664 chenjian2664 Aug 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you give more details about the consequences that what is "redundant operations" in the comments?

Map<String, String> environmentContext = lockingEnabled ? ImmutableMap.of() : environmentContext(metadataLocation);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know anything about this code, but is there a test we can update or add a new one?


// todo privileges should not be replaced for an alter
PrincipalPrivileges privileges = table.getOwner().map(MetastoreUtil::buildInitialPrivilegeSet).orElse(NO_PRIVILEGES);
try {
metastore.replaceTable(table.getDatabaseName(), table.getTableName(), updatedTable, privileges, environmentContext(metadataLocation));
metastore.replaceTable(table.getDatabaseName(), table.getTableName(), updatedTable, privileges, environmentContext);
}
catch (RuntimeException e) {
// Cannot determine whether the `replaceTable` operation was successful,
Expand Down
Loading