-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Remove redundant table metadata calls #17269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove redundant table metadata calls #17269
Conversation
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergMetadata.java
Outdated
Show resolved
Hide resolved
plugin/trino-hive/src/main/java/io/trino/plugin/hive/HiveMetadata.java
Outdated
Show resolved
Hide resolved
87f38f0 to
5c9c4c5
Compare
|
thanks @krvikash , updated |
plugin/trino-mongodb/src/main/java/io/trino/plugin/mongodb/MongoMetadata.java
Outdated
Show resolved
Hide resolved
|
Delta CI is failing. |
5c9c4c5 to
d7ae703
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the new method calling a deprecated method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because getSchemaTableName already existed and can be implemented by a connector
this PR is effectively rename (from ConnectorMetadata perspective) and this is how you handle a rename in a backwards-compatible way
kokosing
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
% comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still nee getTableSchema? It was supposed to be faster than getting table metadata and it is still slow anyway?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good question. io.trino.metadata.Metadata#getTableSchema is still used & not going away
yes, io.trino.metadata.Metadata#getTableSchema is faster than getTableMetadata, but getTableName is even faster (usually no-op, since table handles typically contain the name)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to do this refactor (rename)? Maybe separate commit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i did this because this method was deprecated and almost removed, i didn't want ot add new usages for a method that's already known not to be implemented
would it help if we do #17267 first?
kokosing
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
% comments
|
thank you @kokosing for your review. answered |
This retrofits existing `ConnectorMetadata.getSchemaTableName`. The method remains deprecated, because a new name, `getTableName` is better. As a benefit of this change, the `ConnectorMetadata`'s `getTableMetadata` and `getTableSchema` no longer need to support synthetic table handles. This fixes a bug in connectors that support advanced pushdown. For example, `HiveMetadata.getTableMetadata` called for `HiveTableHandle` having `projectedColumns` should return column metadata for the projected columns, but it did not do that.
d7ae703 to
220afce
Compare
This retrofits existing
ConnectorMetadata.getSchemaTableName. The method remains deprecated, because a new name,getTableNameis better.As a benefit of this change, the
ConnectorMetadata'sgetTableMetadataandgetTableSchemano longer need to support synthetic table handles. This fixes a bug in connectors that support advanced pushdown. For example,HiveMetadata.getTableMetadatacalled forHiveTableHandlehavingprojectedColumnsshould return column metadata for the projected columns, but it did not do that.