Motivation:
Currently flink sql auxiliary statements has supported some good features such as catalog/databases/table support.
...
But these features are not very complete compare with other popular engines such as spark, presto. And these improved features are very useful for users or developers.
Support or Not | Support Filter or Not (in/from or like) | |
show create table | Yes | Yes |
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.
Support or Not | |
describe database | No |
describe table | Yes |
describe function | No |
describe query | No |
current flink only supports describing tables.
So we propose this flip, try to support these features.
Proposed Syntax Changes:
before | after | 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:
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.