CREATE TABLE
Description
Creates a new table in the current database. You define a list of columns, which each hold data of a distinct type. The owner of the table is the issuer of the CREATE TABLE command.
For more information, please refer to CREATE TABLE
documentation.
Grammar Syntax
IF NOT EXISTS
Description
Ensures the table is created only if it does not already exist, preventing duplication and errors in your SQL script.
This syntax is fully supported in Snowflake.
Applies to
Grammar Syntax
Sample Source Patterns
Input Code:
Output Code:
PARTITION BY
Description
Partitions are created on the table, based on the columns specified.
Applies to
Grammar Syntax
Sample Source Patterns
Input Code:
Output Code:
CLUSTERED BY
Description
Partitions created on the table will be bucketed into fixed buckets based on the column specified for bucketing.
This grammar is partially supported
Applies to
Grammar Syntax
The
CLUSTERED BY
clause, used for performance optimization, will be converted toCLUSTER BY
in Snowflake. Performance may vary between the two architectures.The
SORTED BY
clause can be removed during migration, as Snowflake automatically handles data sorting within its micro-partitions.The
INTO BUCKETS
clause, a SparkSQL/Databrick specific partitioning setting, should be entirely eliminated, as it's not applicable in Snowflake.
Sample Source Patterns
Input Code:
Output Code:
ROW FORMAT
Description
Specifies the row format for input and output.
This grammar is not supported in Snowflake
Applies to
Grammar Syntax
Sample Source Patterns
Input Code:
Output Code:
STORED AS
Description
File format for table storage.
This grammar is not supported in Snowflake
Applies to
Grammar Syntax
Sample Source Patterns
Input Code:
Output Code:
Related EWIs
SSC-EWI-SPK0001: CREATE TABLE without columns is not supported in Snowflake.
SSC-EWI-0034: Micro-partitioning is automatically performed on all Snowflake tables.1
Last updated