StarRocks/starrocks

The error message for partition expr is not correct.

Open

#68.567 aberto em 28 de jan. de 2026

Ver no GitHub
 (3 comments) (0 reactions) (1 assignee)Java (1.246 forks)batch import
good first issuetype/bug

Métricas do repositório

Stars
 (5.717 stars)
Métricas de merge de PR
 (Mesclagem média 1d 8h) (999 fundiu PRs em 30d)

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

Guia do colaborador