Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagesql
SHOW CATALOGS

        Return all databases in the current catalog.

        note: already support in sql client but need support in tEnv.sqlQuery();

  • describeCatalogStatement

Code Block
languagesql
DESCRIBE  CATALOG [ EXTENDED] catalogName

       

...

Return the metadata of an existing catalogName 

        EXTENDED:

            Display the catalog properties.

  • useCatalogStatement

Code Block
languagesql
USE CATALOG catalogName 

   

...

    Set the current catalog.    

        note: already support in sql client but need support in tEnv.sqlQuery();

Database DDL:

We propose to add the following DDLs related to database operations.

  • createDatabaseStatement:

...

Code Block
languagesql
 CREATE DATABASE [IF NOT EXISTS] [catalogName.]dataBaseName 

...


 [COMMENT database_comment]

...


 [WITH ( name=value [, name=value]*)]
IF NOT EXISTS:

If a database with the same name already exists, nothing will happen.

  • dropDatabaseStatement:

...

Code Block
languagesql
DROP DATABASE [ IF EXISTS ] [ catalogName.]dataBaseName 

...


[ (RESTRICT|CASCADE)]
IF EXISTS

If the database to drop does not exist, nothing happens.

RESTRICT

Dropping a non-empty database triggers an exception. Enabled by default.

CASCADE

Dropping a non-empty database also drops all associated tables and functions.

  • alterDatabaseStatement:
Code Block
languagesql
ALTER  DATABASE  [ catalogName.] dataBaseName SET DBPROPERTIES

...

 (name=value [, name=value]*)

Set one or more properties in the specified database. If a particular property is already set in the database, override the old value with the new one.

  • useDatabaseStatement:
Code Block
languagesql
USE [ catalogName.] dataBaseName 

Set the current database. All subsequent commands that do not explicitly specify a database will use this one. If the provided database does not exist, an exception is thrown.

note: already support in sql client but need support in tEnv.sqlQuery();

  • showDatabasesStatement:
Code Block
languagesql
 SHOW DATABASES

Return all databases in the current catalog.

note: already support in sql client but need support in tEnv.sqlQuery();

  • descDatabaseStatement:
Code Block
languagesql
DESCRIBE  DATABASE [ EXTENDED] [ catalogName.] dataBasesName 

Return the metadata of an existing database (name, comment). 

EXTENDED:

Display the database properties.

Table DDL:

We propose to add the following DDLs related to table operations.

  • showTablesStatement:

  SHOW TABLES

Return all tables in the current database.

note: already support in sql client but need support in tEnv.sqlQuery();

  • descTableStatement:

  DESCRIBE [ EXTENDED]  [[catalogName.] dataBasesName].tableName

Return the metadata of an existing table (column names, data types, and comments). 

EXTENDED

Display detailed information about the table, including table type, properties and so on.

note: already support in sql client but need support in tEnv.sqlQuery();

  • alterTableStatement:

  ALTER TABLE  [[catalogName.] dataBasesName].tableName 

REAME TO newTableName

Rename an existing table.

ALTER TABLE  [[catalogName.] dataBasesName].tableName 

SET  TBLROPERTIES ( name=value [, name=value]*)

Set the properties of an existing table 

Function DDL:

  • createFunctionStatement:

  CREATE  FUNCTION 

[IF NOT EXISTS] [[catalogName.]databaseName.]functionName AS className.

Create a function indicated by a className

IF NOT EXISTS

If a function with the same name already exists, nothing will happen.

  • dropFunctionStatement:


  DROP  FUNCTION  [IF EXISTS] 

[[catalogName.]databaseName.]functionName.

Create a function indicated by a className

IF EXISTS

If a function with the same name not exists, nothing will happen.

  • alterFunctionStatement:

  ALTER FUNCTION [IF EXISTS] [[catalogName.]databaseName.]functionName 

RENAME TO new_name;

Rename a non-temporary function to new name.


IF EXISTS

If a function with the same name not exists, nothing will happen.

  • showFunctionsStatement:

  SHOW FUNCTIONS

Return all functions in the current database.

note: already support in sql client but need support in tEnv.sqlQuery();

Compatibility, Deprecation, and Migration Plan

  • What impact (if any) will there be on existing users?
  • If we are changing behavior how will we phase out the older behavior?
  • If we need special migration tools, describe them here.
  • When will we remove the existing behavior?

Test Plan

Describe in few sentences how the FLIP will be tested. We are mostly interested in system tests (since unit-tests are specific to implementation details). How will we know that the implementation works as expected? How will we know nothing broke?

Rejected Alternatives

If there are alternative ways of accomplishing the same thing, what were they? The purpose of this section is to motivate why the design is the way it is and not some other way.