-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Unified Materialized View Table Type in information_schema #15350
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -54,6 +54,7 @@ | |
| import static io.trino.connector.informationschema.InformationSchemaMetadata.defaultPrefixes; | ||
| import static io.trino.connector.informationschema.InformationSchemaMetadata.isTablesEnumeratingTable; | ||
| import static io.trino.metadata.MetadataListing.getViews; | ||
| import static io.trino.metadata.MetadataListing.listMaterializedViews; | ||
| import static io.trino.metadata.MetadataListing.listSchemas; | ||
| import static io.trino.metadata.MetadataListing.listTableColumns; | ||
| import static io.trino.metadata.MetadataListing.listTablePrivileges; | ||
|
|
@@ -271,12 +272,18 @@ private void addColumnsRecords(QualifiedTablePrefix prefix) | |
| private void addTablesRecords(QualifiedTablePrefix prefix) | ||
| { | ||
| Set<SchemaTableName> tables = listTables(session, metadata, accessControl, prefix); | ||
| Set<SchemaTableName> materializedViews = listMaterializedViews(session, metadata, accessControl, prefix); | ||
| Set<SchemaTableName> views = listViews(session, metadata, accessControl, prefix); | ||
| // TODO (https://github.com/trinodb/trino/issues/8207) define a type for materialized views | ||
|
|
||
| for (SchemaTableName name : union(tables, views)) { | ||
| for (SchemaTableName name : union(union(tables, materializedViews), views)) { | ||
| // if table and view names overlap, the view wins | ||
| String type = views.contains(name) ? "VIEW" : "BASE TABLE"; | ||
| String type = "BASE TABLE"; | ||
| if (materializedViews.contains(name)) { | ||
| type = "MATERIALIZED VIEW"; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @martint Could you confirm whether returning
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, as it is incompatible with the SQL specification. It may affect tools or clients that expect this table to have return specific values. |
||
| } | ||
| else if (views.contains(name)) { | ||
| type = "VIEW"; | ||
| } | ||
| addRecord( | ||
| prefix.getCatalogName(), | ||
| name.getSchemaName(), | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.