SnowConvert AI - Vertica - CREATE TABLE¶
Description¶
Creates a table in the logical schema. (Vertica SQL Language Reference Create Table).
Warning
This syntax is partially supported in Snowflake. Translation pending for these clauses:
Grammar Syntax¶
Tables Options¶
Order By¶
In Vertica, this ORDER BY clause specifies how data is physically sorted within a superprojection, an optimized storage structure for a table. This explicit physical ordering at table creation is not directly supported in Snowflake. For more information please refer to SSC-EWI-VT0002.
Sample Source¶
Vertica¶
Snowflake¶
Projections Clauses¶
Vertica’s projections are a mechanism to define and maintain the physical sort order of data on disk, thereby optimizing query performance for specific access patterns. Snowflake, however, utilizes a fundamentally different storage and optimization strategy. Data in Snowflake is automatically broken down into immutable micro-partitions, which are then organized and managed by the cloud service.
While an inherent order might exist within these micro-partitions due to insertion or the application of clustering keys, Snowflake’s query optimizer and its underlying architecture are designed to efficiently prune these micro-partitions during query execution, regardless of a pre-defined global sort order. This approach, combined with automatic caching and a columnar storage format, allows Snowflake to achieve high performance without requiring users to manually define and manage physical data structures like Vertica’s projections, thus simplifying data management and optimizing for a broader range of query patterns without explicit physical sort definitions.
Due to these reasons, the following clauses aren’t necessary in Snowflake and are removed from the original code:
Inherited Schema Privileges Clause¶
INCLUDE SCHEMA PRIVILEGES is a Vertica-specific feature that governs how privileges are inherited, in this case, potentially from the schema level. Snowflake does not have a direct equivalent for this clause within its CREATE TABLE syntax. Privileges in Snowflake are managed explicitly through GRANT statements.
Warning
This syntax is not supported in Snowflake.
Sample Source¶
Vertica¶
Snowflake¶
Constraints¶
IDENTITY - AUTO_INCREMENT¶
Creates a table column whose values are automatically generated by and managed by the database. You cannot change or load values in this column. You can set this constraint on only one table column.
Success
This syntax is fully supported in Snowflake.
Sample Source¶
Vertica¶
Snowflake¶
CHECK Constraint¶
The CHECK clause in Vertica requires new or updated rows to satisfy a Boolean expression. Snowflake doesn’t have an equivalent to this clause; therefore, SnowConvert AI will add an EWI. This will be applied as a CHECK attribute or table constraint in the converted code.
Danger
This syntax is not supported in Snowflake.
Sample Source¶
Vertica¶
Snowflake¶
DEFAULT Constraint¶
Warning
This syntax is partially supported in Snowflake.
The basic DEFAULT clause from Vertica is fully supported and translates directly to Snowflake. For Vertica’s DEFAULT USING clause, however, the translation is partial. Snowflake will correctly apply the DEFAULT value when new rows are inserted, but the deferred refresh capability from the USING portion has no direct equivalent and some expressions might not be supported in Snowflake. Therefore, a warning is added to highlight this functional difference.
Sample Source¶
Vertica¶
Snowflake¶
PRIMARY KEY - UNIQUE - FOREIGN KEY¶
SnowConvert AI keeps the constraint definitions; however, in Snowflake, these properties are provided to facilitate migrating from other databases. They are not enforced or maintained by Snowflake. This means that the defaults can be changed for these properties, but changing the defaults results in Snowflake not creating the constraint.
Warning
This syntax is partially supported in Snowflake.
Sample Source¶
Vertica¶
Snowflake¶
CREATE TABLE AS¶
Description¶
Creates and loads a table from the results of a query. (Vertica SQL Language Reference Create Table).
Warning
This syntax is partially supported in Snowflake. Translation pending for the following clauses
Grammar Syntax¶
Tables Options¶
Segmentation Clause¶
This syntax isn’t required in Snowflake and is removed from the original code. For more information, please refer to Projections Clauses.
Note
This syntax is not required in Snowflake.
Inherited Schema Privileges Clause¶
INCLUDE SCHEMA PRIVILEGES is a Vertica-specific feature that governs how privileges are inherited, in this case, potentially from the schema level. Snowflake does not have a direct equivalent for this clause within its CREATE TABLE syntax. For more information please refer to Inherited Schema Privileges Clause.
Warning
This syntax is not supported in Snowflake.
Related EWIs¶
SSC-EWI-VT0001: Inherited privileges clause is not supported in Snowflake.
CREATE TABLE LIKE¶
Description¶
Creates the table by replicating an existing table. (Vertica SQL Language Reference Create Table).
Warning
This syntax is partially supported in Snowflake. Translation pending for the following clause:
Grammar Syntax¶
Tables Options¶
Projections¶
This syntax isn’t required in Snowflake and is removed from the original code. For more information, please refer to Projections Clauses.
Warning
This syntax is not required in Snowflake.
Inherited Schema Privileges Clause¶
INCLUDE SCHEMA PRIVILEGES is a Vertica-specific feature that governs how privileges are inherited, in this case, potentially from the schema level. Snowflake does not have a direct equivalent for this clause within its CREATE TABLE syntax. For more information please refer to Inherited Schema Privileges Clause.
Warning
This syntax is not supported in Snowflake.
Related EWIs¶
SSC-EWI-VT0001: Inherited privileges clause is not supported in Snowflake.