StarRocks/starrocks

The error message for partition expr is not correct.

開放

#68,567 建立於 2026年1月28日

 (3 則留言) (0 個反應) (1 位負責人)Java (1,246 個分叉)batch import
good first issuetype/bug

倉庫指標

星標
 (5,717 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

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

貢獻者指南