| -- test that distributing or hash partitioning by an enum field or expression is blocked |
| CREATE DATABASE ban_enum; |
| \c ban_enum |
| -- create a test enum |
| create type colorEnum as enum ('r', 'g', 'b'); |
| -- hash partition by enum column name |
| create table part (a int, b colorEnum) partition by hash(b); |
| NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Apache Cloudberry data distribution key for this table. |
| HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew. |
| ERROR: cannot use ENUM column "b" in PARTITION BY statement for hash partitions |
| -- hash partition by enum column expression |
| create table part (a int, b colorEnum) partition by hash((b)); |
| NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Apache Cloudberry data distribution key for this table. |
| HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew. |
| ERROR: cannot use ENUM column "(null)" in PARTITION BY statement for hash partitions |
| -- distribute by enum column |
| create table distr (a colorEnum, b int); |
| NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Apache Cloudberry data distribution key for this table. |
| HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew. |
| ERROR: cannot use ENUM column "a" in DISTRIBUTED BY statement |
| -- clean up database |
| drop type colorEnum; |
| \c regression |
| DROP DATABASE ban_enum; |