Skip to content

Commit

Permalink
Remove unnecessary metadata call in DeltaLakeMetadata#beginMerge
Browse files Browse the repository at this point in the history
  • Loading branch information
krvikash committed May 5, 2023
1 parent e611bdc commit 7402b71
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1340,12 +1340,12 @@ public ConnectorInsertTableHandle beginInsert(ConnectorSession session, Connecto
// This check acts as a safeguard in cases where the input columns may differ from the table metadata case-sensitively
checkAllColumnsPassedOnInsert(tableMetadata, inputColumns);

return createInsertHandle(session, retryMode, table, inputColumns, tableMetadata);
return createInsertHandle(session, retryMode, table, inputColumns);
}

private DeltaLakeInsertTableHandle createInsertHandle(ConnectorSession session, RetryMode retryMode, DeltaLakeTableHandle table, List<DeltaLakeColumnHandle> inputColumns, ConnectorTableMetadata tableMetadata)
private DeltaLakeInsertTableHandle createInsertHandle(ConnectorSession session, RetryMode retryMode, DeltaLakeTableHandle table, List<DeltaLakeColumnHandle> inputColumns)
{
String tableLocation = getLocation(tableMetadata.getProperties());
String tableLocation = table.getLocation();
try {
TrinoFileSystem fileSystem = fileSystemFactory.create(session);
return new DeltaLakeInsertTableHandle(
Expand Down Expand Up @@ -1508,13 +1508,11 @@ public ConnectorMergeTableHandle beginMerge(ConnectorSession session, ConnectorT
}
checkWriteSupported(session, handle);

ConnectorTableMetadata tableMetadata = getTableMetadata(session, handle);

List<DeltaLakeColumnHandle> inputColumns = getColumns(handle.getMetadataEntry()).stream()
.filter(column -> column.getColumnType() != SYNTHESIZED)
.collect(toImmutableList());

DeltaLakeInsertTableHandle insertHandle = createInsertHandle(session, retryMode, handle, inputColumns, tableMetadata);
DeltaLakeInsertTableHandle insertHandle = createInsertHandle(session, retryMode, handle, inputColumns);

return new DeltaLakeMergeTableHandle(handle, insertHandle);
}
Expand Down

0 comments on commit 7402b71

Please sign in to comment.