Discussion thread | https://lists.apache.org/thread/l5xx9lgg70y6cbktk810yv4xzx701b04 |
---|---|
Vote thread | |
JIRA | |
Release |
Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).
Motivation:
Currently flink sql auxiliary statements has supported some good features such as catalog/databases/table support.
These features have been a critical integration for Flink to be able to manage metadata like a classic RDBMS and make developers more easy to create or modify or list needed meta datas.
But these features are not very complete compared with other popular engines such as spark, presto. And these improved features are very useful for users or developers.
show | Support or Not | Support filter or Not |
show tables | Yes | Yes |
show columns | Yes | Yes |
show catalogs | Yes | No |
show databases | Yes | No |
show functions | Yes | No |
show views | Yes | No |
show modules | Yes | No |
show jars | Yes | No |
show jobs | Yes | No |
We can see current flink many sql statements only support showing with full datas, without 'FROM/IN' or 'LIKE' filter clause.
show create | Support or Not |
show create database | No |
show create table | Yes |
show create view | Yes |
show create function | No |
describe | Support or Not |
describe catalog | No |
describe database | No |
describe table | Yes |
describe function | No |
describe view | No |
current flink only supports describing tables.
So we propose this flip, try to support these features.
Proposed Syntax Changes:
We compare flink with other popular engines and give an improved syntax example. Welcome everyone to discuss and improve the final syntax.
Because it may be modified under discuss, we put it on the google docs. please see FLIP-297: Improve Auxiliary Sql Statements Docs
before | after(under discussed) | Note | |
show catalogs | SHOW CATALOGS | SHOW CATALOGS [ [NOT] LIKE <sql_like_pattern> ] | |
show databases | SHOW DATABASES | SHOW DATABASES [ ( FROM | IN ) catalog_name] [ [NOT] LIKE <sql_like_pattern> ] | |
show functions | SHOW [USER] FUNCTIONS | SHOW [USER] FUNCTIONS [ ( FROM | IN ) [catalog_name.]database_name ] [ [NOT] LIKE <sql_like_pattern> ] | |
show views | SHOW VIEWS | SHOW VIEWS [ ( FROM | IN ) [catalog_name.]database_name ] [ [NOT] LIKE <sql_like_pattern> ] | |
show modules | SHOW [FULL] MODULES | SHOW [FULL] MODULES [ [NOT] LIKE <sql_like_pattern> ] | |
show jars | SHOW JARS | SHOW JARS [ [NOT] LIKE <sql_like_pattern> ] | only work in SQL CLI or SQL Gateway. |
show jobs | SHOW JOBS | SHOW JOBS [ [NOT] LIKE <sql_like_pattern> ] | only work in SQL CLI or SQL Gateway. |
describe catalog | Not Support | { DESCRIBE | DESC } CATALOG catalog_name | |
describe database | Not Support | { DESCRIBE | DESC } DATABASE [catalog_name.]db_name | |
describe function | Not Support | { DESCRIBE | DESC } FUNCTION [catalog_name.][db_name.]function | |
describe query | Not Support | { DESCRIBE | DESC } [ QUERY ] input_statement |
Proposed TableEnvironment SQL API Changes:
Because `TableEnvironment` is a `@publicEvolving Api`, we may add these override methods or add some SupportsXXX interface to support these features.
details to be added.
Future Work
to be added
Compatibility, Deprecation, and Migration Plan
No compatibility and migration.
Test Plan
Add new cases to cover these features.
Rejected Alternatives
to be added.