StarRocks/starrocks
View on GitHubThe error message for partition expr is not correct.
Open
#68567 opened on Jan 28, 2026
good first issuetype/bug
Description
Steps to reproduce the behavior (Required)
StarRocks > CREATE TABLE IF NOT EXISTS `test_schema_yq4hcg84`.`sr_mv_combo_a_src`
(`order_id` BIGINT, `event_date` DATE, `customer_id` INT, `amount` DECIMAL(18, 2), `region` VARCHAR(50))
PRIMARY KEY (`order_id`, `event_date`)
PARTITION BY `event_date`;
ERROR 1064 (HY000): Getting analyzing error. Detail message: The partition expr should base on key column.
StarRocks > CREATE TABLE IF NOT EXISTS `test_schema_yq4hcg84`.`sr_mv_combo_a_src`
(`order_id` BIGINT, `event_date` DATE, `customer_id` INT, `amount` DECIMAL(18, 2), `region` VARCHAR(50))
PRIMARY KEY (`order_id`, `event_date`)
PARTITION BY (`event_date`);
Query OK, 0 rows affected (0.03 sec)
The only diff is the parentheses for PARTITION BY.
- PARTITION BY
event_date - PARTITION BY (
event_date)
Expected behavior (Required)
- According to the expression partitioning syntax, the first only should be success too.
- And error "The partition expr should base on key column" is not correct.
Real behavior (Required)
ERROR 1064 (HY000): Getting analyzing error. Detail message: The partition expr should base on key column.
for the first create table statement.
StarRocks version (Required)
- 3.5.8