-
Notifications
You must be signed in to change notification settings - Fork 1.8k
feat(catalog): Implement information_schema.views #2934
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
feat(catalog): Implement information_schema.views #2934
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2934 +/- ##
==========================================
+ Coverage 85.29% 85.34% +0.04%
==========================================
Files 274 273 -1
Lines 49229 49380 +151
==========================================
+ Hits 41991 42141 +150
- Misses 7238 7239 +1
Continue to review full report at Codecov.
|
alamb
left a comment
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.
I took it for a spin. Looks great @BaymaxHWY thank you!
Looks like we can even support SHOW VIEWS now (as part of a follow on PR, no ned to add it to this one)
❯ create table foo as select column1 as id from (values ('1'), ('3'), ('2'), ('10'), ('8'));
+----+
| id |
+----+
| 1 |
| 3 |
| 2 |
| 10 |
| 8 |
+----+
5 rows in set. Query took 0.043 seconds.
❯ create view bar as select count(*) from foo;
+-----------------+
| COUNT(UInt8(1)) |
+-----------------+
| 5 |
+-----------------+
1 row in set. Query took 0.017 seconds.
❯ show views;
NotImplemented("SHOW views not implemented. Supported syntax: SHOW <TABLES>")
❯ show tables;
+---------------+--------------------+------------+------------+
| table_catalog | table_schema | table_name | table_type |
+---------------+--------------------+------------+------------+
| datafusion | public | foo | BASE TABLE |
| datafusion | public | bar | VIEW |
| datafusion | information_schema | tables | VIEW |
| datafusion | information_schema | views | VIEW |
| datafusion | information_schema | columns | VIEW |
+---------------+--------------------+------------+------------+
5 rows in set. Query took 0.006 seconds.
❯ select * from information_schema.views;
+---------------+--------------+------------+---------------------------------------------+
| table_catalog | table_schema | table_name | definition |
+---------------+--------------+------------+---------------------------------------------+
| datafusion | public | foo | |
| datafusion | public | bar | CREATE VIEW bar AS SELECT count(*) FROM foo |
+---------------+--------------+------------+---------------------------------------------+
2 rows in set. Query took 0.002 seconds.
❯ show create table bar;
+---------------+--------------+------------+---------------------------------------------+
| table_catalog | table_schema | table_name | definition |
+---------------+--------------+------------+---------------------------------------------+
| datafusion | public | bar | CREATE VIEW bar AS SELECT count(*) FROM foo |
+---------------+--------------+------------+---------------------------------------------+
1 row in set. Query took 0.010 seconds.|
Benchmark runs are scheduled for baseline = 136f27f and contender = d11e28a. d11e28a is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
Which issue does this PR close?
Closes #2857
Rationale for this change
What changes are included in this PR?
information_schema.viewsdefinitionfrominformation_schema.tablesSHOW CREATE TABLEAre there any user-facing changes?