Skip to content

Fix starrocks expression partition parse#6508

Open
qingzheguo-flash wants to merge 3 commits intoalibaba:masterfrom
qingzheguo-flash:fix-starrocks-expr-partition
Open

Fix starrocks expression partition parse#6508
qingzheguo-flash wants to merge 3 commits intoalibaba:masterfrom
qingzheguo-flash:fix-starrocks-expr-partition

Conversation

@qingzheguo-flash
Copy link

Fix starrocks expression partition sql parse:
before fix starrocks parser always expect a "(" after we defined partition columns, but starrocks support expression partition now, this will cause parse failure when we create expression partition table:https://docs.starrocks.io/docs/table_design/data_distribution/expression_partitioning/#partitioning-based-on-the-column-expression-since-v31

image

so I fixed support for expression partition.

Also fixed some exist unit tests in StarRocksCreateTableParserTest

fix StarRocksCreateTableParserTest.java exists unit tests
fix StarRocksCreateTableParserTest.java exists unit tests
@CLAassistant
Copy link

CLAassistant commented Aug 17, 2025

CLA assistant check
All committers have signed the CLA.

@wenshao wenshao requested a review from lingo-xp August 21, 2025 12:55
@qingzheguo-flash
Copy link
Author

Hi @lingo-xp . Could you please help review this PR? Thank you!

accept(Token.LPAREN);
for (; ; ) {
if (lexer.token() == Token.RPAREN) {
if (lexer.token() == Token.LPAREN) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you can use nextIf, like this:

if (lexer.nextIf(Token.LPAREN)) {
//We don't need to use accept here.
}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, please take a look, thanks. @wenshao

@qingzheguo-flash qingzheguo-flash force-pushed the fix-starrocks-expr-partition branch from cf78d5a to aaaa815 Compare February 13, 2026 08:37
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

Successfully merging this pull request may close these issues.

3 participants