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 @@ -19,7 +19,6 @@
import javax.inject.Inject;
import javax.inject.Provider;

import java.util.Map;
import java.util.function.Predicate;

import static java.util.Objects.requireNonNull;
Expand All @@ -40,18 +39,8 @@ public DeltaLakeGlueMetastoreTableFilterProvider(DeltaLakeGlueMetastoreConfig co
public Predicate<Table> get()
{
if (hideNonDeltaLakeTables) {
return DeltaLakeGlueMetastoreTableFilterProvider::isDeltaLakeTable;
return DefaultGlueMetastoreTableFilterProvider::isDeltaLakeTable;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

io.trino.plugin.deltalake.metastore.glue.DeltaLakeGlueMetastoreTableFilterProvider#isDeltaLakeTable is now unused

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

:| i pressed cmd+z too many times...

}
return table -> true;
}

private static boolean isDeltaLakeTable(Table table)
{
Map<String, String> parameters = table.getParameters();
if (parameters == null) {
return false;
}
// todo; add parameters == null check to DefaultGlueMetastoreTableFilterProvider.isDeltaLakeTable (https://github.com/trinodb/trino/issues/12013)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

remove Map<String, String> parameters = table.getParameters(); above too

Copy link
Copy Markdown
Member Author

@homar homar Apr 25, 2022

Choose a reason for hiding this comment

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

Why ? To me it is a 'fast path' for returning false. @findepi

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

it's a code piece that is now redundant. we wouldn't write it originally if DefaultGlueMetastoreTableFilterProvider.isDeltaLakeTable didn't have a problem

actually, the whole method should get inlined now

return DefaultGlueMetastoreTableFilterProvider.isDeltaLakeTable(table);
}
}