...
We propose to add the following DDLs related to catalog operations.
createCatalogStatement:
CREATE CATALOG [ IF NOT EXISTS ] catalogName |
IF NOT EXISTS:
If a catalog with the same name already exists, nothing will happen.
- showCatalogsStatement
SHOW CATALOGS |
Return all catalogs in the current catalog.
note: already support in sql client but need support in TableEnvironment.
describeCatalogStatement
DESCRIBE CATALOG catalogName |
Return the default database name and expalnCatalog(newly added method in the catalog) content of an existing catalogName
Newly added method in Catalog.java:
/** |
use eg:
Flink SQL> describe catalog hiveCatalog; |
useCatalogStatement
USE CATALOG catalogName |
Set the current catalog.
...
We propose to add the following DDLs related to database operations.
createDatabaseStatement:
CREATE DATABASE [ IF NOT EXISTS ] [ catalogName.] dataBaseName |
IF NOT EXISTS:
If a database with the same name already exists, nothing will happen.
dropDatabaseStatement:
DROP DATABASE [ IF EXISTS ] [ catalogName.] dataBaseName |
IF EXISTS
If the database to drop does not exist, nothing happens.
...
Catalog.dropDatabase method should add new cascade flag
/** * @param cascade Flag to specify behavior when the database is not empty |
alterDatabaseStatement:
ALTER DATABASE [ catalogName.] dataBaseName SET |
PROPERTIES |
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:
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:
SHOW DATABASES |
Return all databases in the current catalog.
note: already support in sql client but need support in tEnv.sqlQuery();
descDatabaseStatement:
DESCRIBE DATABASE [ EXTENDED] [ catalogName.] dataBasesName |
Return the metadata of an existing database (name, comment, description).
...
Return the metadata of an existing database (name, comment, description, properties and detailed description).
use eg:
FLINK SQL> describe database hive.default; |
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 TableEnvironment.
descTableStatement:
DESCRIBE [ EXTENDED] [[catalogName.] dataBasesName].tableName |
Return the metadata of an existing table (column names, data types, and comments).
...
note: already support in sql client but need support in TableEnvironment.
alterTableStatement:
ALTER TABLE [[catalogName.] dataBasesName].tableName |
Rename an existing table.
ALTER TABLE [[catalogName.] dataBasesName].tableName |
Set the properties of an existing table
...