Skip to content

Rename listTables to listRelations to avoid confusion#19920

Closed
findepi wants to merge 4 commits intomasterfrom
findepi/list-relations
Closed

Rename listTables to listRelations to avoid confusion#19920
findepi wants to merge 4 commits intomasterfrom
findepi/list-relations

Conversation

@findepi
Copy link
Copy Markdown
Member

@findepi findepi commented Nov 27, 2023

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

Extracted from #19832

The "tables" is often used to refer to tables only. "Relations"
better indicates the method includes tables, views and materialized
views.
@cla-bot cla-bot bot added the cla-signed label Nov 27, 2023
@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 27, 2023
Copy link
Copy Markdown
Member

@mosabua mosabua left a comment

Choose a reason for hiding this comment

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

Is there no better name for these objects in a schema? Relations is just very abstract. Objects is maybe a bit to broad since other things like functions can be found in a schema ..

What does the SQL spec call them @martint ?

In either way .. I like the idea to rename this .. but it should be consistent and hence also touch the result returned from the methods

}

public static Set<SchemaTableName> listTables(Session session, Metadata metadata, AccessControl accessControl, QualifiedTablePrefix prefix)
public static Set<SchemaTableName> listRelations(Session session, Metadata metadata, AccessControl accessControl, QualifiedTablePrefix prefix)
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.

At min you should add javadoc here .. but it also looks weird .. you are calling listRelations .. but getting back a set of SchemaTableName objects? Would you not have to rename SchemaTablenName to SchemaRelation as well then to be consistent?

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.

In other places we use QualifiedObjectName ..

@martint
Copy link
Copy Markdown
Member

martint commented Nov 27, 2023

What does the SQL spec call them @martint ?

See my comment here: #19832 (comment)

@sajjoseph
Copy link
Copy Markdown
Contributor

At my workplace, lot of people refer to tables/views/mv as subjects. listRelations sounds bit of a departure from the nomenclature in rest of the codebase even though I understand the reasoning behind it.

@losipiuk
Copy link
Copy Markdown
Member

What does the SQL spec call them @martint ?

See my comment here: #19832 (comment)

@martint can you put your thoughts on the replies to your comment on the other PR. The points raised there resonate very much with me.

@findepi findepi requested a review from a team November 28, 2023 20:58
@findepi
Copy link
Copy Markdown
Member Author

findepi commented Dec 1, 2023

Looking forward to more review comments.

@martint
Copy link
Copy Markdown
Member

martint commented Dec 1, 2023

@martint can you put your thoughts on the replies to your comment on the other PR. The points raised there resonate very much with me.

Sure. I would suggest we rename the methods to: listAllTables or listAllTableObjects (everything) vs listViews, listMaterializedViews, listBaseTables, etc., as appropriate.

@github-actions
Copy link
Copy Markdown

This pull request has gone a while without any activity. Tagging the Trino developer relations team: @bitsondatadev @colebow @mosabua

@github-actions github-actions bot added the stale label Jan 10, 2024
@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 1, 2024

Closing this pull request, as it has been stale for six weeks. Feel free to re-open at any time.

@github-actions github-actions bot closed this Feb 1, 2024
@findepi findepi reopened this Feb 1, 2024
@mosabua
Copy link
Copy Markdown
Member

mosabua commented Feb 1, 2024

Whoa .. sorry @findepi .. the bot should not have closed a PR .. I will see what happened there .. cc @colebow

@github-actions github-actions bot removed the stale label Feb 2, 2024
@github-actions
Copy link
Copy Markdown

This pull request has gone a while without any activity. Tagging the Trino developer relations team: @bitsondatadev @colebow @mosabua

@github-actions github-actions bot added the stale label Feb 28, 2024
@findepi findepi closed this Feb 28, 2024
@findepi findepi deleted the findepi/list-relations branch February 28, 2024 17:17
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 stale

Development

Successfully merging this pull request may close these issues.

6 participants