Search before asking
Version
4.1
What's Wrong?
You can no longer use CLUSTER BY in a unique key table create statement.
CREATE TABLE foo
( ... )
UNIQUE KEY (myKey)
CLUSTER BY (something)
...
[HY000][1105] errCode = 2, detailMessage =
mismatched input 'CLUSTER' expecting {<EOF>, ';'}(line 10, pos 0)
Does not matter where you place it, it fails.
### What You Expected?
CREATE TABLE test_cluster_by
(
user_id LARGEINT NOT NULL,
username VARCHAR(50) NOT NULL,
city VARCHAR(20),
age SMALLINT,
sex TINYINT
)
UNIQUE KEY(user_id, username)
CLUSTER BY (city, age)
DISTRIBUTED BY HASH(user_id) BUCKETS 10
PROPERTIES (
"replication_num" = "1",
"enable_unique_key_merge_on_write" = "true"
);
returns
> [HY000][1105] errCode = 2, detailMessage = mismatched input 'CLUSTER' expecting {<EOF>, ';'}(line 10, pos 0
export it not to fail
### How to Reproduce?
CREATE TABLE test_cluster_by
(
user_id LARGEINT NOT NULL,
username VARCHAR(50) NOT NULL,
city VARCHAR(20),
age SMALLINT,
sex TINYINT
)
UNIQUE KEY(user_id, username)
CLUSTER BY (city, age)
DISTRIBUTED BY HASH(user_id) BUCKETS 10
PROPERTIES (
"replication_num" = "1",
"enable_unique_key_merge_on_write" = "true"
);
### Anything Else?
_No response_
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
Search before asking
Version
4.1
What's Wrong?
You can no longer use
CLUSTER BYin a unique key table create statement.CREATE TABLE test_cluster_by
(
user_id LARGEINT NOT NULL,
username VARCHAR(50) NOT NULL,
city VARCHAR(20),
age SMALLINT,
sex TINYINT
)
UNIQUE KEY(user_id, username)
CLUSTER BY (city, age)
DISTRIBUTED BY HASH(user_id) BUCKETS 10
PROPERTIES (
"replication_num" = "1",
"enable_unique_key_merge_on_write" = "true"
);
CREATE TABLE test_cluster_by
(
user_id LARGEINT NOT NULL,
username VARCHAR(50) NOT NULL,
city VARCHAR(20),
age SMALLINT,
sex TINYINT
)
UNIQUE KEY(user_id, username)
CLUSTER BY (city, age)
DISTRIBUTED BY HASH(user_id) BUCKETS 10
PROPERTIES (
"replication_num" = "1",
"enable_unique_key_merge_on_write" = "true"
);