1- DROP TABLE IF EXISTS sales_heap;
2- DROP TABLE
1+ -- Create various types of tables for migration compatibility test
2+ --
3+ -- List of tables in Summary
4+ -- Name | Type | Partition by | Storage
5+ ------------------------------+-------------------+--------------+----------------------
6+ -- sales_ao | table | | append only
7+ -- sales_aocs | table | | append only columnar
8+ -- sales_heap | table | | heap
9+ -- sales_partition_ao | partitioned table | range |
10+ -- sales_partition_aocs | partitioned table | hash |
11+ -- sales_partition_heap | partitioned table | list |
12+ -- sales_partition_ao_part1 | table | | append only
13+ -- sales_partition_ao_part2 | table | | append only
14+ -- sales_partition_ao_part3 | table | | append only
15+ -- sales_partition_aocs_part1 | table | | append only columnar
16+ -- sales_partition_aocs_part2 | table | | append only columnar
17+ -- sales_partition_aocs_part3 | table | | append only columnar
18+ -- sales_partition_heap_part1 | table | | heap
19+ -- sales_partition_heap_part2 | table | | heap
20+ -- sales_partition_heap_part3 | table | | heap
21+ --
22+ -- Heap Table
23+ DROP TABLE IF EXISTS sales_heap;
24+ NOTICE: table "sales_heap" does not exist, skipping
325CREATE TABLE IF NOT EXISTS sales_heap
426(
527 product_id INT,
@@ -14,13 +36,13 @@ CREATE TABLE IF NOT EXISTS sales_heap
1436 status CHAR(10),
1537 customer_name VARCHAR(20),
1638 price DECIMAL(20, 10)
17- ) DISTRIBUTED BY (product_id);
18- CREATE TABLE
19- ---
39+ )
40+ DISTRIBUTED BY (product_id);
41+ -- Heap Table, Partition by LIST
2042DROP TABLE IF EXISTS sales_partition_heap;
21- DROP TABLE
43+ NOTICE: table "sales_partition_heap" does not exist, skipping
2244CREATE TABLE IF NOT EXISTS sales_partition_heap
23- (
45+ (
2446 product_id INT,
2547 is_audited BOOLEAN DEFAULT FALSE,
2648 quantity SMALLINT,
@@ -33,18 +55,128 @@ CREATE TABLE IF NOT EXISTS sales_partition_heap
3355 status CHAR(10),
3456 customer_name VARCHAR(20),
3557 price DECIMAL(20, 10)
36- ) DISTRIBUTED BY (product_id)
58+ )
59+ DISTRIBUTED BY (product_id)
3760PARTITION BY LIST (status);
38- CREATE TABLE
3961CREATE TABLE sales_partition_heap_part1
4062PARTITION OF sales_partition_heap
4163FOR VALUES IN ('Cancelled');
42- CREATE TABLE
64+ NOTICE: table has parent, setting distribution columns to match parent table
4365CREATE TABLE sales_partition_heap_part2
4466PARTITION OF sales_partition_heap
4567FOR VALUES IN ('Closed');
46- CREATE TABLE
68+ NOTICE: table has parent, setting distribution columns to match parent table
4769CREATE TABLE sales_partition_heap_part3
4870PARTITION OF sales_partition_heap
4971FOR VALUES IN ('Processing');
50- CREATE TABLE
72+ NOTICE: table has parent, setting distribution columns to match parent table
73+ -- AO Table
74+ DROP TABLE IF EXISTS sales_ao;
75+ NOTICE: table "sales_ao" does not exist, skipping
76+ CREATE TABLE IF NOT EXISTS sales_ao
77+ (
78+ product_id INT,
79+ is_audited BOOLEAN DEFAULT FALSE,
80+ quantity SMALLINT,
81+ total_sales BIGINT,
82+ unit_price REAL,
83+ discount DOUBLE PRECISION,
84+ description TEXT,
85+ sale_date TIMESTAMP,
86+ order_date DATE,
87+ status CHAR(10),
88+ customer_name VARCHAR(20),
89+ price DECIMAL(20, 10)
90+ )
91+ WITH (appendonly=true)
92+ DISTRIBUTED BY (product_id);
93+ -- AO Table, Partition by Range
94+ DROP TABLE IF EXISTS sales_partition_ao;
95+ NOTICE: table "sales_partition_ao" does not exist, skipping
96+ CREATE TABLE IF NOT EXISTS sales_partition_ao
97+ (
98+ product_id INT,
99+ is_audited BOOLEAN DEFAULT FALSE,
100+ quantity SMALLINT,
101+ total_sales BIGINT,
102+ unit_price REAL,
103+ discount DOUBLE PRECISION,
104+ description TEXT,
105+ sale_date TIMESTAMP,
106+ order_date DATE,
107+ status CHAR(10),
108+ customer_name VARCHAR(20),
109+ price DECIMAL(20, 10)
110+ )
111+ DISTRIBUTED BY (product_id)
112+ PARTITION BY RANGE (order_date);
113+ CREATE TABLE sales_partition_ao_part1
114+ PARTITION OF sales_partition_ao
115+ FOR VALUES FROM ('2023-01-01') TO ('2024-01-01')
116+ WITH (appendonly=true);
117+ NOTICE: table has parent, setting distribution columns to match parent table
118+ CREATE TABLE sales_partition_ao_part2
119+ PARTITION OF sales_partition_ao
120+ FOR VALUES FROM ('2024-01-01') TO ('2025-01-01')
121+ WITH (appendonly=true);
122+ NOTICE: table has parent, setting distribution columns to match parent table
123+ CREATE TABLE sales_partition_ao_part3
124+ PARTITION OF sales_partition_ao
125+ FOR VALUES FROM ('2025-01-01') TO ('2026-01-01')
126+ WITH (appendonly=true);
127+ NOTICE: table has parent, setting distribution columns to match parent table
128+ -- AOCS Table
129+ DROP TABLE IF EXISTS sales_aocs;
130+ NOTICE: table "sales_aocs" does not exist, skipping
131+ CREATE TABLE IF NOT EXISTS sales_aocs
132+ (
133+ product_id INT,
134+ is_audited BOOLEAN DEFAULT FALSE,
135+ quantity SMALLINT,
136+ total_sales BIGINT,
137+ unit_price REAL,
138+ discount DOUBLE PRECISION,
139+ description TEXT,
140+ sale_date TIMESTAMP,
141+ order_date DATE,
142+ status CHAR(10),
143+ customer_name VARCHAR(20),
144+ price DECIMAL(20, 10)
145+ )
146+ WITH (appendonly=true, orientation=column)
147+ DISTRIBUTED BY (product_id);
148+ -- AOCS Table, Partition by Hash
149+ DROP TABLE IF EXISTS sales_partition_aocs;
150+ NOTICE: table "sales_partition_aocs" does not exist, skipping
151+ CREATE TABLE IF NOT EXISTS sales_partition_aocs
152+ (
153+ product_id INT,
154+ is_audited BOOLEAN DEFAULT FALSE,
155+ quantity SMALLINT,
156+ total_sales BIGINT,
157+ unit_price REAL,
158+ discount DOUBLE PRECISION,
159+ description TEXT,
160+ sale_date TIMESTAMP,
161+ order_date DATE,
162+ status CHAR(10),
163+ customer_name VARCHAR(20),
164+ price DECIMAL(20, 10)
165+ )
166+ DISTRIBUTED BY (product_id)
167+ PARTITION BY HASH(description);
168+ CREATE TABLE sales_partition_aocs_part1
169+ PARTITION OF sales_partition_aocs
170+ FOR VALUES WITH (MODULUS 3, REMAINDER 0)
171+ WITH (appendonly=true, orientation=column);
172+ NOTICE: table has parent, setting distribution columns to match parent table
173+ CREATE TABLE sales_partition_aocs_part2
174+ PARTITION OF sales_partition_aocs
175+ FOR VALUES WITH (MODULUS 3, REMAINDER 1)
176+ WITH (appendonly=true, orientation=column);
177+ NOTICE: table has parent, setting distribution columns to match parent table
178+ CREATE TABLE sales_partition_aocs_part3
179+ PARTITION OF sales_partition_aocs
180+ FOR VALUES WITH (MODULUS 3, REMAINDER 2)
181+ WITH (appendonly=true, orientation=column);
182+ NOTICE: table has parent, setting distribution columns to match parent table
0 commit comments