apatrida opened a new issue, #62727:
URL: https://github.com/apache/doris/issues/62727

   ### Search before asking
   
   - [x] I had searched in the 
[issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### 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)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to