CREATE MATERIALIZE VIEW
Translation reference to convert Greenplum Materialized View to Snowflake Dynamic Table
Description
In Snowconvert, Materialized Views are transformed into Snowflake Dynamic Tables. To properly configure Dynamic Tables, two essential parameters must be defined: TARGET_LAG and WAREHOUSE. If these parameters are left unspecified in the configuration options, Snowconvert will default to preassigned values during the conversion, as demonstrated in the example below.
Grammar Syntax
Code Examples
Simple Case
Input Code:
Output Code:
IF NOT EXISTS
This syntax is fully supported in Snowflake.
This clause has been removed during the migration from Greenplum to Snowflake.
USING, TABLESPACE, and WITH
These clauses are removed during the conversion process. In Greenplum, they are used to further customize data storage manually. This is something that Snowflake handles automatically (micro partitions), and it is typically not a concern.
DISTRIBUTED BY
This syntax is translated to its most equivalent form in Snowflake.
The DISTRIBUTED BY clause in Greenplum controls how data is physically distributed across the system's segments. Meanwhile, CLUSTER BY is a subset of columns in a dynamic table (or expressions on a dynamic table) explicitly designated to co-locate the data in the table in the same micro-partitions. While they operate at different architectural levels, they aim to improve query performance by distributing data efficiently.
Grammar Syntax
Sample Source
Input Code:
Output Code:
DISTRIBUTED RANDOMLY - REPLICATED
The DISTRIBUTED REPLICATED or DISTRIBUTED RANDOMLY clause in Greenplum controls how data is physically distributed across the system's segments. As Snowflake automatically handles data storage, these options will be removed in the migration.
Related EWIs
SSC-FDM-GP0001: The performance of the CLUSTER BY may vary compared to the performance of Distributed By.
SSC-FDM-0031: Dynamic Table required parameters set by default
Last updated