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

Show Presto views as views, not tables #8243

Merged
merged 7 commits into from
Sep 18, 2019
Merged

Conversation

betodealmeida
Copy link
Member

CATEGORY

Choose one

  • Bug Fix
  • Enhancement (new features, refinement)
  • Refactor
  • Add tests
  • Build / Development Environment
  • Documentation

SUMMARY

Currently, Presto displays views as tables, since the statement SHOW TABLES shows both views and tables, and there's no SHOW VIEWS.

One workaround to get the list of views is to query the information_schema schema:

SELECT table_name FROM information_schema_views WHERE table_schema='default';

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:

Screen Shot 2019-09-17 at 5 37 27 PM

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Requires DB Migration.
  • Confirm DB Migration upgrade and downgrade tested.
  • Introduces new feature or API
  • Removes existing feature or API

REVIEWERS

@khtruong @etr2460

@codecov-io
Copy link

codecov-io commented Sep 18, 2019

Codecov Report

Merging #8243 into master will decrease coverage by 0.04%.
The diff coverage is 42.1%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8243      +/-   ##
==========================================
- Coverage   65.72%   65.68%   -0.05%     
==========================================
  Files         481      481              
  Lines       23317    23348      +31     
  Branches     2572     2572              
==========================================
+ Hits        15326    15335       +9     
- Misses       7853     7875      +22     
  Partials      138      138
Impacted Files Coverage Δ
superset/assets/src/components/TableSelector.jsx 77.69% <ø> (ø) ⬆️
superset/models/core.py 81.93% <ø> (ø) ⬆️
superset/views/core.py 70.36% <0%> (-0.05%) ⬇️
superset/db_engine_specs/presto.py 70.26% <28%> (-2.12%) ⬇️
superset/db_engine_specs/postgres.py 93.54% <66.66%> (-3.01%) ⬇️
superset/db_engine_specs/sqlite.py 70.96% <75%> (-1.45%) ⬇️
superset/db_engine_specs/base.py 85.38% <80%> (-0.24%) ⬇️
superset/connectors/druid/models.py 81.71% <0%> (+0.04%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8877794...ec6b252. Read the comment docs.

superset/db_engine_specs/base.py Outdated Show resolved Hide resolved
@betodealmeida betodealmeida merged commit 12fb8e7 into apache:master Sep 18, 2019
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.35.0 labels Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/M 🚢 0.35.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants