Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

解析结果partitioning 均为SQLPartitionByList对象 无法区分 LIST LIST COLUMNS分区类型 #6163

Open
zhanghuancode opened this issue Oct 12, 2024 · 3 comments

Comments

@zhanghuancode
Copy link

dbtype: OceanBase
dbversion: V4.22
druid verion: 1.2.23
jdk verion: 1.8
error sql:
CREATE TABLE t2_m_lh (col1 INT NOT NULL,col2 varchar(50),col3 INT NOT NULL)
PARTITION BY LIST (col1)
SUBPARTITION BY HASH(col3) SUBPARTITIONS 3
(PARTITION p0 VALUES IN(100),
PARTITION p1 VALUES IN(200),
PARTITION p2 VALUES IN(300)
);
CREATE TABLE t2_m_lch(col1 INT,col2 INT)
PARTITION BY LIST COLUMNS(col1)
SUBPARTITION BY HASH(col2) SUBPARTITIONS 5
(PARTITION p0 VALUES IN(100),
PARTITION p1 VALUES IN(200),
PARTITION p2 VALUES IN(300)
);

testcase code:
stacktrace info:
error info: 解析结果partitioning 均为SQLPartitionByList对象 无法区分 LIST LIST COLUMNS分区类型

@lingo-xp
Copy link
Collaborator

目前druid解析流程中是根据col个数去判断使用list还是list columns, 通常单个partition by col的时候用的是partition by list (col1), 多个的时候是partition by list columns (col1, col2), 所以想确认下当前的测试用例是否正确。

@zhanghuancode
Copy link
Author

在LIST分区中,PARTITION BY LIST(expr),expr是整数型的列或者返回值为整数的列的表达式,LIST COLUMNS存在两个重要的区分:
1. 在 LIST COLUMNS分区中,使用PARTITION BY LIST COLUMNS(column_list),column_list是单个或者多个列名,不再是表达式。
2. LIST COLUMNS分区不再局限于整数列。
若需字符串类型作为LIST COLUMNS的一列则不适用于LIST分区。生成的对应SQL异常。

@lingo-xp
Copy link
Collaborator

Fixed #6253

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants