[ 
https://issues.apache.org/jira/browse/FLINK-25684?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jark Wu reassigned FLINK-25684:
-------------------------------

    Assignee: Moses

> Support enhanced show databases syntax
> --------------------------------------
>
>                 Key: FLINK-25684
>                 URL: https://issues.apache.org/jira/browse/FLINK-25684
>             Project: Flink
>          Issue Type: Improvement
>          Components: Table SQL / API
>            Reporter: Moses
>            Assignee: Moses
>            Priority: Major
>              Labels: pull-request-available
>
> Enhanced `show databases` statement like ` show databasesfrom like 'db%' ` 
> has been supported broadly in many popular SQL engine like Spark SQL/MySQL.
> We could use such statement to easily show the databases that we wannted.
> h3. SHOW DATABSES [ LIKE regex_pattern ]
> Examples:
> {code:java}
> Flink SQL> create database db1;
> [INFO] Execute statement succeed.
> Flink SQL> create database db1_1;
> [INFO] Execute statement succeed.
> Flink SQL> create database pre_db;
> [INFO] Execute statement succeed.
> Flink SQL> show databases;
> +------------------+
> |    database name |
> +------------------+
> | default_database |
> |              db1 |
> |            db1_1 |
> |           pre_db |
> +------------------+
> 4 rows in set
> Flink SQL> show databases like 'db1';
> +---------------+
> | database name |
> +---------------+
> |           db1 |
> +---------------+
> 1 row in set
> Flink SQL> show databases like 'db%';
> +---------------+
> | database name |
> +---------------+
> |           db1 |
> |         db1_1 |
> +---------------+
> 2 rows in set
> Flink SQL> show databases like '%db%';
> +---------------+
> | database name |
> +---------------+
> |           db1 |
> |         db1_1 |
> |        pre_db |
> +---------------+
> 3 rows in set
> Flink SQL> show databases like '%db';
> +---------------+
> | database name |
> +---------------+
> |        pre_db |
> +---------------+
> 1 row in set
> {code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to