-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
Better distinction between tables and views, and show CREATE VIEW #8213
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor comments, otherwise LGTM
This is a nice feature. However, it seems to be unnecessarily specific to Presto, and should be fairly easy to enable for other engines, too, by moving as much of the logic as possible to |
I agree. I think we need to start by adding an abstract method to |
@mistercrunch is this good to go as soon as tests pass? |
LGTM. It hit me, that we should also offer a "get CREATE TABLE statement". I often like to add comments for both table and columns, and those would be convenient to see with the click of a button. So down the line perhaps |
245a8ba
to
584ad25
Compare
584ad25
to
8beb36c
Compare
Codecov Report
@@ Coverage Diff @@
## master #8213 +/- ##
==========================================
- Coverage 65.79% 65.72% -0.07%
==========================================
Files 480 481 +1
Lines 23273 23317 +44
Branches 2567 2572 +5
==========================================
+ Hits 15312 15326 +14
- Misses 7823 7853 +30
Partials 138 138
Continue to review full report at Codecov.
|
CATEGORY
Choose one
SUMMARY
In SQL Lab, to distinguish between tables and views we prefix the latter with the string
[view]
, which looks ugly. I changed it to display a small icon representing the type — either a table for actual tables, or an eye for views.Additionally, we don't present any information on views. I added a link to show the actual
CREATE VIEW
statement that defines a given view.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TEST PLAN
Currently most DB engine specs seem to return views as tables, due to limitations in the SQL Alchemy driver. Both Presto and SQLlite return no views, bundling the views with the actual tables. I had to mock the response from the engines to generate the screenshots.
I'm planning to write a PR for Presto next, allowing views to be properly displayed. This might require changes upstream (to https://github.com/dropbox/PyHive), though it's possible to work around it in Superset only.
ADDITIONAL INFORMATION
REVIEWERS
@mistercrunch @khtruong @etr2460