Tables

Translation reference to convert Teradata TABLE statement to Snowflake

Important Notice: Migration of Documentation Website

Please be advised that our documentation website is currently undergoing a migration to a new platform. To ensure you have access to the most up-to-date information, we kindly request that you visit our new documentation website located at:

Official Snowflake Snowconvert Documentation

For any immediate assistance or if you encounter any issues, please contact our support team at [email protected].

Thank you for your understanding.

Some parts in the output code are omitted for clarity reasons.

Description

Teradata's TABLE statement is translated to Snowflake TABLE syntax.

For more information on Teradata TABLEs, check here.

Sample Source Patterns

Simple Create​ Table

Teradata

IN -> Teradata_01.sql
CREATE TABLE table1, no fallback,
no before journal,
no after journal (
  c1 INTEGER NOT NULL,
	f1 INTEGER NOT NULL,
	p1 INTEGER NOT NULL,
  DATE,
  TIME,
	FOREIGN KEY(f1) REFERENCES WITH CHECK OPTION table2 (d1)
)
UNIQUE PRIMARY INDEX(c1)
PARTITION BY COLUMN(p1);

Snowflake

Table Kind Clause - SET and MULTISET

Teradata's kind clause determines whether duplicate rows are permitted (MULTISET) or not (SET).

Teradata

Snowflake

Volatile and Global Temporary Tables

Teradata's Volatile and Global Temporary tables are used for the temporary storage of data. Their difference lies in that the table definition (DDL) of Global Temporary tables is persisted in the Data Dictionary, while Volatile tables definition is not stored.

Teradata

Snowflake

With data and with no data option

Teradata

Snowflake

Snowflake's Reserved & Limited Keywords

SnowConvert facilitates seamless SQL migrations to Snowflake by addressing challenges associated with reserved keywords. As per Snowflake's reserved and limited keyword documentation, certain keywords cannot be used as column names, table names, or aliases without special handling. SnowConvert includes functionality to ensure SQL code compatibility in such cases.

Reserved ANSI Keywords as Column Names

For column names that match ANSI or Snowflake reserved keywords, SnowConvert automatically wraps the column name in double quotes (") to comply with Snowflake's syntax rules. This adjustment ensures that queries with these column names compile correctly in Snowflake without requiring manual intervention.

Example:

Snowflake

Snowflake-Specific Reserved Keywords

Columns that match Snowflake-specific reserved keywords (e.g., CONSTRAINT, CURRENT_DATE, CURRENT_TIME) may still cause compilation issues even when wrapped in quotes. SnowConvert detects these instances and generates a warning with code SSC-EWI-0045, prompting users to review and potentially rename these columns for compatibility.

Example:

Snowflake

Known Issues

1. Create table options not supported

As shown in the example "Simple Create Table", Snowflake does not support Teradata create table options. They are removed.

2. Partition by performance issues

In the example "Simple Create Table", the partition by statement is removed due to performance considerations.

3. Primary Index moved

In Teradata, the primary index constraint is declared outside of the create table statement, but in Snowflake it is required to be inside, as shown in the example "Simple Create Table".

4. SET semantics not supported

As shown in the example "Table Kind Clause - SET and MULTISET", Snowflake does not support Teradata's SET semantics. They are removed.

5. Global Temporary table option not supported

As shown in the example "Volatile and Global Temporary Table", Snowflake does not support Teradata's Global Temporary table option. It will be removed.

6. Compress unsupported

COMPRESS (value1. value2, value3) is removed due to being unsupported.

7. On commit unsupported

On commit is removed due to being unsupported.

8. Block compression unsupported

Block compression is removed due to being unsupported.

9. Normalize unsupported

Normalize is removed due to being unsupported.

  1. SSC-FDM-0009: GLOBAL TEMPORARY TABLE functionality not supported.

  2. SSC-FDM-0019: Sematic information could not be loaded.

  3. SSC-FDM-TD0024: Set table functionality not supported.

  4. SSC-PRF-0007: CLUSTER BY performance review.

  5. SSC-EWI-0045: Column Name is Snowflake Reserved Keyword.

Last updated