Skip to content
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

Allow fetching relation names with their types #19832

Closed
wants to merge 4 commits into from

Conversation

findepi
Copy link
Member

@findepi findepi commented Nov 20, 2023

This reduces number of Glue calls when reading from
information_schema.tables or system.jdbc.tables.

@cla-bot cla-bot bot added the cla-signed label Nov 20, 2023
@findepi
Copy link
Member Author

findepi commented Nov 20, 2023

cc @trinodb/maintainers

@github-actions github-actions bot added jdbc Relates to Trino JDBC driver tests:hive hudi Hudi connector iceberg Iceberg connector delta-lake Delta Lake connector hive Hive connector labels Nov 20, 2023
@findepi findepi force-pushed the findepi/relation-types branch 2 times, most recently from e8b3e21 to 8ef0cd0 Compare November 20, 2023 20:58
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 think "relation" is a clearer term. Views, materialized views, etc. are all just "tables" - at least in anything associated with the SQL spec. If we're going to attempt to distinguish regular tables from views and friends, then we should be talking about derived tables, base tables, views, temporary tables, etc. which are all just "tables". A "regular" table (i.e., not a view or materialized view) is just a "base table".

Copy link
Member Author

Choose a reason for hiding this comment

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

I see your point and agree from sql perspective. "tables" is an overloaded term and sometimes it refers to regular tables (not views), sometimes to any relations (tables per above). The confusion is amplified by "list tables" and "list views" methods living in same interface (ConnectorMetadata, or HiveMetastore). They look complementary, and i've seen people confused about them, but they are not. The Trino SPI handles tables and views differently (eg getTableHandle vs getView), despite them being "just tables" from SQL perspective, making the confusion even easier.

Copy link
Member Author

Choose a reason for hiding this comment

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

The "tables" is often used to refer to tables only. "Relations"
better indicates the method includes tables, views and materialized
views.

This is a preparatory step for introducing a method to list all
relations with their types.
This reduces number of Glue calls when reading from
`information_schema.tables` or `system.jdbc.tables`.
@findepi findepi force-pushed the findepi/relation-types branch from a4a33c5 to b979ffe Compare November 22, 2023 14:56
@mosabua
Copy link
Member

mosabua commented Nov 24, 2023

Close this one since the alternative PR is merged?

@losipiuk losipiuk closed this Nov 26, 2023
@losipiuk losipiuk deleted the findepi/relation-types branch November 26, 2023 18:33
@losipiuk losipiuk restored the findepi/relation-types branch November 26, 2023 18:33
@findepi findepi deleted the findepi/relation-types branch November 27, 2023 16:17
@findepi
Copy link
Member Author

findepi commented Nov 27, 2023

prep part resubmitted as #19920

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed delta-lake Delta Lake connector hive Hive connector hudi Hudi connector iceberg Iceberg connector jdbc Relates to Trino JDBC driver
Development

Successfully merging this pull request may close these issues.

4 participants