Flink DDL
Cloudera SQL Stream Builder (SSB) supports the Flink SQL statements that create, change, and remove tables, views, functions, catalogs, and databases.
Data Definition Language (DDL) statements create, change, and remove objects such as tables and views. You can run DDL statements in the SQL editor of the Streaming SQL Console, or create tables with the table wizards. For more information, see Creating Flink DDL tables.
| Statement | Description | Usage notes |
|---|---|---|
CREATE TABLE |
Creates a table with one of the supported connectors. | Add WATERMARK and PRIMARY KEY definitions,
computed columns, and metadata columns. Use the LIKE clause to create
a table from the definition of another table. For the connectors, see Supported
connectors. |
CREATE VIEW |
Creates a logical view from a query. A view does not store data. | The query can contain expressions, joins, and aggregations. |
CREATE FUNCTION |
Registers a Python user-defined function. | User-defined functions need storage: a bucket bound
to the default purpose of the engine. For more information, see
Preparing storage for Cloudera Streaming Analytics and
Adding Python user-defined functions. |
CREATE CATALOG |
Registers a catalog. | For the catalog types that SSB supports, see Catalogs. A Hive catalog is not available in this release. |
CREATE DATABASE |
Creates a database in the current catalog or in a catalog that you name. | Not every catalog supports creating databases. |
ALTER TABLE |
Changes a table. | Use RENAME TO to rename the table, SET and
RESET to change its options, and ADD,
MODIFY, and DROP to change its columns, primary
key, and watermark. |
ALTER VIEW |
Changes a view. | Use RENAME TO to rename the view, or AS to
replace its query. |
ALTER FUNCTION |
Changes the definition of a user-defined function. | You define user-defined functions in the Streaming SQL Console. ALTER FUNCTION works for a function that you created with DDL. |
ALTER DATABASE |
Changes the properties of a database. | |
DROP TABLE, DROP VIEW, DROP
FUNCTION, DROP CATALOG, DROP
DATABASE |
Removes the object. | Add IF EXISTS to skip objects that do not exist. You can also
delete tables in the Streaming SQL Console. |
For the full syntax, see CREATE statements, ALTER statements, and DROP statements in the Apache Flink documentation.
