|
| 1 | +-- test partition by list |
| 2 | +CREATE TABLE t3 ( |
| 3 | + str oracle.varchar2(30) |
| 4 | +) PARTITION BY LIST (str) |
| 5 | +( |
| 6 | + PARTITION t3_1 VALUES ('a', 'b'), |
| 7 | + PARTITION t3_2 VALUES ('c') |
| 8 | +); |
| 9 | +NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'str' as the Greenplum Database data distribution key for this table. |
| 10 | +HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew. |
| 11 | +INSERT INTO t3 VALUES ('a'), ('b'), ('c'); |
| 12 | +SELECT * FROM t3 ORDER BY str; |
| 13 | + str |
| 14 | +----- |
| 15 | + a |
| 16 | + b |
| 17 | + c |
| 18 | +(3 rows) |
| 19 | + |
| 20 | +\d+ t3 |
| 21 | + Partitioned table "public.t3" |
| 22 | + Column | Type | Collation | Nullable | Default | Storage | Stats target | Description |
| 23 | +--------+---------------------+-----------+----------+---------+----------+--------------+------------- |
| 24 | + str | oracle.varchar2(30) | | | | extended | | |
| 25 | +Partition key: LIST (str) |
| 26 | +Partitions: t3_1_prt_t3_1 FOR VALUES IN ('a', 'b'), |
| 27 | + t3_1_prt_t3_2 FOR VALUES IN ('c') |
| 28 | +Distributed by: (str) |
| 29 | + |
| 30 | +CREATE TABLE t4 ( |
| 31 | + str oracle.nvarchar2(30) |
| 32 | +) PARTITION BY LIST (str) |
| 33 | +( |
| 34 | + PARTITION t4_1 VALUES ('a', 'b'), |
| 35 | + PARTITION t4_2 VALUES ('c') |
| 36 | +); |
| 37 | +NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'str' as the Greenplum Database data distribution key for this table. |
| 38 | +HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew. |
| 39 | +INSERT INTO t4 VALUES ('a'), ('b'), ('c'); |
| 40 | +SELECT * FROM t4 ORDER BY str; |
| 41 | + str |
| 42 | +----- |
| 43 | + a |
| 44 | + b |
| 45 | + c |
| 46 | +(3 rows) |
| 47 | + |
| 48 | +\d+ t4 |
| 49 | + Partitioned table "public.t4" |
| 50 | + Column | Type | Collation | Nullable | Default | Storage | Stats target | Description |
| 51 | +--------+----------------------+-----------+----------+---------+----------+--------------+------------- |
| 52 | + str | oracle.nvarchar2(30) | | | | extended | | |
| 53 | +Partition key: LIST (str) |
| 54 | +Partitions: t4_1_prt_t4_1 FOR VALUES IN ('a', 'b'), |
| 55 | + t4_1_prt_t4_2 FOR VALUES IN ('c') |
| 56 | +Distributed by: (str) |
| 57 | + |
| 58 | +-- test partition by hash |
| 59 | +CREATE TABLE t5 ( |
| 60 | + str oracle.varchar2(30) |
| 61 | +) PARTITION BY HASH (str); |
| 62 | +NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'str' as the Greenplum Database data distribution key for this table. |
| 63 | +HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew. |
| 64 | +CREATE TABLE t5_1 PARTITION OF t5 FOR VALUES WITH (MODULUS 3, REMAINDER 0); |
| 65 | +NOTICE: table has parent, setting distribution columns to match parent table |
| 66 | +CREATE TABLE t5_2 PARTITION OF t5 FOR VALUES WITH (MODULUS 3, REMAINDER 1); |
| 67 | +NOTICE: table has parent, setting distribution columns to match parent table |
| 68 | +CREATE TABLE t5_3 PARTITION OF t5 FOR VALUES WITH (MODULUS 3, REMAINDER 2); |
| 69 | +NOTICE: table has parent, setting distribution columns to match parent table |
| 70 | +INSERT INTO t5 VALUES ('a'), ('b'), ('c'); |
| 71 | +SELECT * FROM t5_1 ORDER BY str; |
| 72 | + str |
| 73 | +----- |
| 74 | + b |
| 75 | +(1 row) |
| 76 | + |
| 77 | +SELECT * FROM t5_2 ORDER BY str; |
| 78 | + str |
| 79 | +----- |
| 80 | +(0 rows) |
| 81 | + |
| 82 | +SELECT * FROM t5_3 ORDER BY str; |
| 83 | + str |
| 84 | +----- |
| 85 | + a |
| 86 | + c |
| 87 | +(2 rows) |
| 88 | + |
| 89 | +\d+ t5 |
| 90 | + Partitioned table "public.t5" |
| 91 | + Column | Type | Collation | Nullable | Default | Storage | Stats target | Description |
| 92 | +--------+---------------------+-----------+----------+---------+----------+--------------+------------- |
| 93 | + str | oracle.varchar2(30) | | | | extended | | |
| 94 | +Partition key: HASH (str) |
| 95 | +Partitions: t5_1 FOR VALUES WITH (modulus 3, remainder 0), |
| 96 | + t5_2 FOR VALUES WITH (modulus 3, remainder 1), |
| 97 | + t5_3 FOR VALUES WITH (modulus 3, remainder 2) |
| 98 | +Distributed by: (str) |
| 99 | + |
| 100 | +CREATE TABLE t6 ( |
| 101 | + str oracle.nvarchar2(30) |
| 102 | +) PARTITION BY HASH (str); |
| 103 | +NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'str' as the Greenplum Database data distribution key for this table. |
| 104 | +HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew. |
| 105 | +CREATE TABLE t6_1 PARTITION OF t6 FOR VALUES WITH (MODULUS 3, REMAINDER 0); |
| 106 | +NOTICE: table has parent, setting distribution columns to match parent table |
| 107 | +CREATE TABLE t6_2 PARTITION OF t6 FOR VALUES WITH (MODULUS 3, REMAINDER 1); |
| 108 | +NOTICE: table has parent, setting distribution columns to match parent table |
| 109 | +CREATE TABLE t6_3 PARTITION OF t6 FOR VALUES WITH (MODULUS 3, REMAINDER 2); |
| 110 | +NOTICE: table has parent, setting distribution columns to match parent table |
| 111 | +INSERT INTO t6 VALUES ('a'), ('b'), ('c'); |
| 112 | +SELECT * FROM t6_1 ORDER BY str; |
| 113 | + str |
| 114 | +----- |
| 115 | + b |
| 116 | +(1 row) |
| 117 | + |
| 118 | +SELECT * FROM t6_2 ORDER BY str; |
| 119 | + str |
| 120 | +----- |
| 121 | +(0 rows) |
| 122 | + |
| 123 | +SELECT * FROM t6_3 ORDER BY str; |
| 124 | + str |
| 125 | +----- |
| 126 | + a |
| 127 | + c |
| 128 | +(2 rows) |
| 129 | + |
| 130 | +\d+ t6 |
| 131 | + Partitioned table "public.t6" |
| 132 | + Column | Type | Collation | Nullable | Default | Storage | Stats target | Description |
| 133 | +--------+----------------------+-----------+----------+---------+----------+--------------+------------- |
| 134 | + str | oracle.nvarchar2(30) | | | | extended | | |
| 135 | +Partition key: HASH (str) |
| 136 | +Partitions: t6_1 FOR VALUES WITH (modulus 3, remainder 0), |
| 137 | + t6_2 FOR VALUES WITH (modulus 3, remainder 1), |
| 138 | + t6_3 FOR VALUES WITH (modulus 3, remainder 2) |
| 139 | +Distributed by: (str) |
| 140 | + |
| 141 | +DROP TABLE t3; |
| 142 | +DROP TABLE t4; |
| 143 | +DROP TABLE t5; |
| 144 | +DROP TABLE t6; |
0 commit comments