Skip to content

add "STORAGE TABLE" and "MATERIALIZED VIEW" type in information_schema.tables#10745

Closed
duoluodexiaokeke wants to merge 2 commits intotrinodb:masterfrom
duoluodexiaokeke:trino-369-add_table_type
Closed

add "STORAGE TABLE" and "MATERIALIZED VIEW" type in information_schema.tables#10745
duoluodexiaokeke wants to merge 2 commits intotrinodb:masterfrom
duoluodexiaokeke:trino-369-add_table_type

Conversation

@duoluodexiaokeke
Copy link
Copy Markdown
Contributor

add "STORAGE TABLE" and "MATERIALIZED VIEW" type in information_schema.tables
"show tables" command filter out storage table

information_schema.tables
"show tables" command filter out storage table
@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented Jan 22, 2022

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: liul.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented Jan 24, 2022

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please submit the signed CLA to cla@trino.io. For more information, see https://github.com/trinodb/cla.

type = "VIEW";
}
else if (mviews.contains(name)) {
type = "MATERIALIZE VIEW";
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.

This was left as a TODO (see a few lines above https://github.com/trinodb/trino/pull/10745/files#diff-de0b2e0ffdaf5c2eeda3ad7f0513ad28373a158a1f4fbe32ef0a10f5ce10cc73L283) because information schema table is supposed to follow ANSI SQL spec and we didn't have clarity about which table type should be used for MVs if it is to be differentiated from the others.
fyi @sopel39 @findepi @martint

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.

If we want to follow spec, we should return "VIEW" for materialized views.
but let's wait maybe @martint has more thoughts on this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

materialize view and normal view is different, so i think they are different type

type = "MATERIALIZE VIEW";
}
else if (storageTables.contains(name)) {
type = "STORAGE TABLE";
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.

I don't think we can give a separate type to storage table of MVs unless the ANSI SQL spec for information schema allows it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

base table and mv table is different.
show tables command will print storage table, but i don't think this table should show

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.

from tables perspective, mv's storage table is a table just as any other table.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

you are right.
But from the user's point of view, they didn't create the storage tables. so these are transparent to users. they not need to find those table when used "show tabales" command;

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.

But from the user's point of view, they didn't create the storage tables.

It doesn't matter who created a table and why.

they not need to find those table when used "show tabales" command;

i'd suggesting filing up an issue for this to facilitate a discussion.
i will happily explain why i think we should not bar users from accessing the tables storing mv information directly.

@mosabua
Copy link
Copy Markdown
Member

mosabua commented Nov 3, 2022

👋 @duoluodexiaokeke given the discussion in #12559 and the fact that #12591 is merged, maybe this PR is no longer needed. Please chime in to the discussion there.

@findepi
Copy link
Copy Markdown
Member

findepi commented Jan 19, 2023

Superseded by #15350

@findepi findepi closed this Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants