StarRocks/starrocks

The error message for partition expr is not correct.

Open

#68567 opened on Jan 28, 2026

View on GitHub
 (3 comments) (0 reactions) (1 assignee)Java (5,717 stars) (1,246 forks)batch import
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.

  1. PARTITION BY event_date
  2. PARTITION BY (event_date)

Expected behavior (Required)

  1. According to the expression partitioning syntax, the first only should be success too.
  2. 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

Contributor guide