CREATE TABLE

CREATE TABLE

Syntax

CREATE TABLE table_name (

   column_name data_type [, ...]

) WITH (table_parameter = value [, ...]);

Description

This DDL statement is used to define a new Table.

Arguments

table_name

Specifies the name of the table. If the name is case sensitive you must wrap it in double quotes; otherwise the system uses the lower case name.

column_name

The name of a column in the stream. If the name is case sensitive you must wrap it in double quotes; otherwise the system uses the lower case name.

data_type

The data type of the column. This can include array specifiers. For more information on the data types supported by DeltaStream, see the Data Types reference.

WITH (table_parameter = value [, …​ ])

Optionally, this clause specifies table parameters.

Table Parameters

Parameter Name
Description

store

Name of the store that hosts the #entity for this stream.

Required: No

Default value: Current session's store name Type: String

Valid values: See LIST STORES.

Iceberg Specific Parameters

Parameter Name
Description

iceberg.aws.glue.db.name

The name of the database (namespace) in the AWS Glue instance (used as the Iceberg Catalog implementation in the Iceberg Store) containing the existing Iceberg table. Required: Yes

Type: String

iceberg.aws.glue.table.name

The name of the existing Iceberg table in the AWS Glue instance (used as the Iceberg Catalog implementation in the Iceberg Store).

Required: Yes

Type: String

Example

Create a new table backed by an Iceberg table

The following creates a new Table, named pageviews_iceberg. This table is backed by an existing Iceberg table, called iceberg_table in the iceberg_store store. iceberg_table is defined in the gluedb database in the AWS Glue catalog, used by the store.

CREATE TABLE pageviews_iceberg (
  viewtime BIGINT, 
  userid VARCHAR, 
  pageid VARCHAR) WITH (
  'store'='iceberg_store',
  'iceberg.aws.glue.db.name'='gluedb',
  'iceberg.aws.glue.table.name'='iceberg_table'
);

Last updated