SnowConvert AI – Greenplum – CREATE TABLE¶
Übersetzung von Greenplum in Snowflake
Beschreibung¶
In diesem Abschnitt werden Features erläutert, die ausschließlich von Greenplum bereitgestellt werden.
Weitere Informationen dazu finden Sie in der Dokumentation zu CREATE TABLE.
Grammatikalische Syntax¶
CREATE TABLE <table_name> (
[ <column_name> <data_type> [ ENCODING ( <storage_directive> [, ...] ) ]
] )
[ DISTRIBUTED BY ( <column> [<opclass>] [, ... ] )
| DISTRIBUTED RANDOMLY
| DISTRIBUTED REPLICATED ]
ENCODING¶
Bemerkung
Diese Syntax wird in Snowflake nicht benötigt.
Die Komprimierungscodierung für eine Spalte. Das Definieren von ENCODING in Snowflake ist nicht erforderlich, da das Programm die Datenkomprimierung automatisch durchführt, im Gegensatz zu Greenpum, wo die Codierung manuell eingerichtet wird. Aus diesem Grund wird die ENCODING-Anweisung während der Migration entfernt.
Grammatikalische Syntax¶
ENCODING ( <storage_directive> [, ...] )
Beispielquelle¶
Eingabecode:¶
Greenplum¶
CREATE TABLE TABLE1 (
COL1 integer ENCODING (compresstype = quicklz, blocksize = 65536)
);
Ausgabecode:¶
Snowflake¶
CREATE TABLE TABLE1 (
COL1 integer
)
COMMENT = '{ "origin": "sf_sc", "name": "snowconvert", "version": { "major": 0, "minor": 0, "patch": "0" }, "attributes": { "component": "greenplum", "convertedOn": "03/26/2025", "domain": "test" }}'
;
DISTRIBUTED-BY¶
Hinweis
Diese Syntax wird in Snowflake vollständig unterstützt.
Die DISTRIBUTED BY-Klausel in Snowflake steuert, wie die Tabellendaten physisch über die Segmente des Systems verteilt werden. Währenddessen ist CLUSTER BY eine Teilmenge von Spalten oder Ausdrücken in einer Tabelle, die explizit dazu bestimmt sind, Daten in denselben Mikropartitionen der Tabelle zusammenzulegen.
Grammatikalische Syntax¶
DISTRIBUTED BY ( <column> [<opclass>] [, ... ] )
Beispielhafte Quellcode-Muster¶
Eingabecode:¶
Greenplum¶
CREATE TABLE table1 (colum1 int, colum2 int, colum3 smallint, colum4 int )
DISTRIBUTED BY (colum1, colum2);
Ausgabecode:¶
Snowflake¶
CREATE TABLE table1 (colum1 int, colum2 int, colum3 smallint, colum4 int )
--** SSC-FDM-GP0001 - THE PERFORMANCE OF THE CLUSTER BY MAY VARY COMPARED TO THE PERFORMANCE OF DISTRIBUTED BY **
CLUSTER BY (colum1, colum2)
COMMENT = '{ "origin": "sf_sc", "name": "snowconvert", "version": { "major": 0, "minor": 0, "patch": "0" }, "attributes": { "component": "greenplum", "convertedOn": "03/26/2025", "domain": "test" }}'
;
DISTRIBUTED RANDOMLY - REPLICATED¶
Bemerkung
Diese Syntax wird in Snowflake nicht benötigt.
Die DISTRIBUTED REPLICATED- oder DISTRIBUTED RANDOMLY-Klausel in Snowflake steuert, wie die Tabellendaten physisch über die Segmente des Systems verteilt werden. Da Snowflake die Datenspeicherung automatisch handhabt, werden diese Optionen bei der Migration entfernt.
Grammatikalische Syntax¶
DISTRIBUTED RANDOMLY | DISTRIBUTED REPLICATED
Beispielhafte Quellcode-Muster¶
Eingabecode:¶
Greenplum¶
CREATE TABLE table1 (colum1 int, colum2 int, colum3 smallint, colum4 int )
DISTRIBUTED RANDOMLY;
Ausgabecode:¶
Snowflake¶
CREATE TABLE table1 (colum1 int, colum2 int, colum3 smallint, colum4 int )
COMMENT = '{ "origin": "sf_sc", "name": "snowconvert", "version": { "major": 0, "minor": 0, "patch": "0" }, "attributes": { "component": "greenplum", "convertedOn": "03/26/2025", "domain": "test" }}'
;