-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[feature](external catalog)Add partition grammar for external catalog to create table #31585
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
[feature](external catalog)Add partition grammar for external catalog to create table #31585
Conversation
|
Thank you for your contribution to Apache Doris. |
| : functions+=partitionFunction (COMMA functions+=partitionFunction)* | ||
| ; | ||
|
|
||
| partitionFunction |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is better use functionCallExpression directly, and in LogicalPlanBuilder check return expression is UnboundFunction
| @Override | ||
| public Expression visitPartitionFunction(DorisParser.PartitionFunctionContext ctx) { | ||
| String name = ctx.identity.getText(); | ||
| List<Expression> params = visit(ctx.expression(), Expression.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do u test this syntax? i think u want get is ctx.arguments()
| partitionFunctionCallExpression | ||
| : LEFT_PAREN partitionFunctionList RIGHT_PAREN | ||
| ; | ||
|
|
||
| partitionFunctionList | ||
| : functions+=partitionFunction (COMMA functions+=partitionFunction)* | ||
| ; | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not merge this two statement into one?
LEFT_PAREN functions+=partitionFunction (COMMA functions+=partitionFunction)* RIGHT_PAREN
| partitionType, | ||
| ctx.partitionKeys != null ? visitIdentifierList(ctx.partitionKeys) : null, | ||
| ctx.partitions != null ? visitPartitionsDef(ctx.partitions) : null, | ||
| partitionInfo.isAutoPartition(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if u aready merge all partition info into one class, u'd better update CreateTableInfo's ctor to accept PartitionTableInfo as parameter
|
run buildall |
TPC-H: Total hot run time: 32082 ms |
TPC-DS: Total hot run time: 189294 ms |
ClickBench: Total hot run time: 26.62 s |
|
run buildall |
|
run buildall |
TPC-H: Total hot run time: 37617 ms |
TPC-DS: Total hot run time: 178480 ms |
ClickBench: Total hot run time: 30.21 s |
|
Load test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G' |
|
run buildall |
TPC-H: Total hot run time: 38091 ms |
TPC-DS: Total hot run time: 177078 ms |
ClickBench: Total hot run time: 31.51 s |
|
Load test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G' |
|
run buildall |
morningman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| } | ||
| } else if (!engineName.equals("olap")) { | ||
| if (partitionDesc != null || distributionDesc != null) { | ||
| if (!engineName.equals("hms") && distributionDesc != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if (!engineName.equals("hms") && distributionDesc != null) { | |
| if (!engineName.equals("hive") && distributionDesc != null) { |
| + " table should not contain partition or distribution desc"); | ||
| + " table should not contain distribution desc"); | ||
| } | ||
| if (!engineName.equals("hms") && !engineName.equals("iceberg") && partitionDesc != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if (!engineName.equals("hms") && !engineName.equals("iceberg") && partitionDesc != null) { | |
| if (!engineName.equals("hive") && !engineName.equals("iceberg") && partitionDesc != null) { |
|
PR approved by at least one committer and no changes requested. |
|
run buildall |
1 similar comment
|
run buildall |
|
run buildall |
1 similar comment
|
run buildall |
|
run p0 |
1 similar comment
|
run p0 |
morningman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
PR approved by at least one committer and no changes requested. |
kaka11chen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
… to create table (#31585) The `PARTITION BY` syntax used by external catalogs has been added. You can specify a column directly, or a partition function as a partition condition. Like: `PARTITION BY LIST(col1, col2, func(param), func(param1, param2), func(param1, param2, param3))` NOTICE: This PR change the grammar of `AUTO PARTITION` From ``` AUTO PARTITION BY RANGE date_trunc(`TIME_STAMP`, 'month') ``` To ``` AUTO PARTITION BY RANGE (date_trunc(`TIME_STAMP`, 'month')) ```
fix legacy planner grammer fix nereids planner parsing fix cases forbid auto range partition with null column fix CreateTableStmt with auto partition and some partition items. 1 and 2 are about #31585 doc pr: apache/doris-website#488
…e#32737) fix legacy planner grammer fix nereids planner parsing fix cases forbid auto range partition with null column fix CreateTableStmt with auto partition and some partition items. 1 and 2 are about apache#31585 doc pr: apache/doris-website#488
…e#32737) fix legacy planner grammer fix nereids planner parsing fix cases forbid auto range partition with null column fix CreateTableStmt with auto partition and some partition items. 1 and 2 are about apache#31585 doc pr: apache/doris-website#488
… (#33412) fix legacy planner grammer fix nereids planner parsing fix cases forbid auto range partition with null column fix CreateTableStmt with auto partition and some partition items. 1 and 2 are about #31585 doc pr: apache/doris-website#488
…e#32737) fix legacy planner grammer fix nereids planner parsing fix cases forbid auto range partition with null column fix CreateTableStmt with auto partition and some partition items. 1 and 2 are about apache#31585 doc pr: apache/doris-website#488
AUTO PARTITION grammar has changed since apache#31585, but the output of SHOW CREATE TABLE was left out to change, so the result is not able to be recognized by the FE parser.
AUTO PARTITION grammar has changed since #31585, but the output of SHOW CREATE TABLE was left out to change, so the result is not able to be recognized by the FE parser.
AUTO PARTITION grammar has changed since #31585, but the output of SHOW CREATE TABLE was left out to change, so the result is not able to be recognized by the FE parser.
AUTO PARTITION grammar has changed since #31585, but the output of SHOW CREATE TABLE was left out to change, so the result is not able to be recognized by the FE parser.
Proposed changes
The
PARTITION BYsyntax used by external catalogs has been added.You can specify a column directly, or a partition function as a partition condition.
Like:
PARTITION BY LIST(col1, col2, func(param), func(param1, param2), func(param1, param2, param3))NOTICE:
This PR change the grammar of
AUTO PARTITIONFrom
To
Further comments
If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...