CREATE TABLE AS SELECT
Last updated
Last updated
CREATE TABLE AS
is a statement that:
Generates a DDL statement to create a new .
Launches a new query to write the results of the SELECT statement into the newly created table.
This specifies the name of the new table. Optionally, use <database_name>.<schema_name>
as the prefix to the name to create the relation in that namespace. If the name is case sensitive you must wrap it in double quotes; otherwise the system uses the lower case name.
Optionally, this clause specifies Table Parameters.
This statement specifies the SELECT statement to run.
store
The name of the store that hosts the entity for this stream.
Required: No Default value: User’s default Store.
Type: String Valid values: See LIST STORES
snowflake.db.name
Required: Yes Default values: None Type: String Valid values: Database names available from LIST ENTITIES.
snowflake.schema.name
Required: Yes
Default value: None
Type: String
Valid values: Schema names available from LIST ENTITIES under the snowflake.db.name
database name.
snowflake.table.name
snowflake.buffer.millis
It is important to note that the longer events are buffered, the larger the internal state of the query gets. Depending on the volume and size of the events for the corresponding query, memory limitations may be reached. Required: No Default value: 1000 Type: Long Valid values: (0, ...]
databricks.catalog.name
Required: Yes Default values: None Type: String Valid values: Database names available from LIST ENTITIES.
databricks.schema.name
Required: Yes
Default value: None
Type: String
Valid values: Schema names available from LIST ENTITIES under the databricks.catalog.name
catalog name.
databricks.table.name
table.data.file.location
The S3 directory location for the Delta-formatted data to be written. The credentials for writing to S3 are given during store creation (see CREATE STORE). Note that the S3 bucket from the location specified by this parameter must match the databricks.cloud.s3.bucket
property defined in the store.
Required: Yes
Default value: None
Type: String
This query stores all changes to the grouping column cc_type
to the sink table CC_TYPE_USAGE
.
Upon issuing this query, a Databricks table is created in catalog1.schema1.pageviews
that uses s3://mybucket/test/0/pageviews
as its external location. This query writes the Delta-formatted parquet files and updates the Delta log in that S3 location.
The name of the Snowflake database that would host the Snowflake .
The name of the Snowflake schema that would host the Snowflake .
The name of the Snowflake table to use when creating the . If the table doesn't exist in the store, a table with the table_name
is created in the corresponding store.
Required: No
Default value: table_name
Type: String
The amount of time to buffer events with the sink before writing the data into the corresponding Snowflake table.
Snowflake stores provide a delivery guarantee of at_least_once
when producing events into a sink . Snowflake stores provide an insert-only mode when writing to Snowflake tables.
The name of the Databricks catalog that would host the Databricks .
The name of the Databricks schema that would host the Databricks .
The name of the Databricks table to use when creating the . A table with the table_name
is created in the corresponding store. If that table already exists, then an error is reported back to the user.
Required: No
Default value: table_name
Type: String
Databricks stores provide a delivery guarantee of exactly_once
when producing events into a sink . Databricks stores provide an insert-only mode when writing to Databricks tables.
The following creates a replica of the source , pageviews
in the Snowflake , PV_TABLE
:
The following CTAS query creates a new Snowflake to store incremental changes resulting from a grouping aggregation on the transactions
:
The following creates a replica of the source , pageviews
in the Databricks , pageviews_db
: