Versions Compared

Key

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

...

  • alterDatabaseStatement:
Code Block
languagesql
ALTER ALTER
 DATABASE DATABASE [ catalogName.] dataBaseName SET DBPROPERTIES (name=value [, name=value]*)

...

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

  • showTablesStatement:

Code Block
languagesql
  SHOW TABLES

Return all tables in the current database.

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

  • descTableStatement:

Code Block
languagesql
  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:

 

Code Block
languagesql
ALTER TABLE  [[catalogName.] dataBasesName].tableName 

...



REAME TO newTableName

Rename an existing table.

Code Block
languagesql
ALTER

...

 TABLE [[catalogName.] dataBasesName].tableName 

...



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

Set the properties of an existing table 

Function DDL:

  • createFunctionStatement:

Code Block
languagesql
  CREATE  FUNCTION 

...

[IF NOT EXISTS] [[

...

catalog
Name.]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:


Code Block
languagesql
  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:

Code Block
languagesql
  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:

Code Block
languagesql
  SHOW FUNCTIONS

Return all functions in the current database.

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

Implementation Changes:

  1. Unify the parser way of SQL CLI and Flink SQL parser
  2. Add DDL mentioned above one by one in flink sql parser and support execute both in SQL CL and TableEnvironment.sqlQuery() or TableEnvironment.sqlUpdate()

Compatibility, Deprecation, and Migration Plan

...