Show Presto views as views, not tables #8243
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
CATEGORY
Choose one
SUMMARY
Currently, Presto displays views as tables, since the statement
SHOW TABLES
shows both views and tables, and there's noSHOW VIEWS
.One workaround to get the list of views is to query the
information_schema
schema:This returns the actual list of views, but it's slow. On our Presto cluster it takes approximately 90 seconds to get all the views across all schemas. Fortunately, the API that exposes the views is cached, so this shouldn't be too bad.
I added a new feature flag,
PRESTO_SPLIT_VIEWS_FROM_TABLES
(open for better name suggestions), that when enabled will show views differently than tables in SQL Lab.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Now views are properly marked as such in Presto:
ADDITIONAL INFORMATION
REVIEWERS
@khtruong @etr2460