feat(starrocks): add full support for partitions#6804
Merged
geooo109 merged 4 commits intotobymao:mainfrom Jan 26, 2026
Merged
Conversation
f93c63c to
09aef20
Compare
Collaborator
|
@petrikoro thank you for the PR, great work. I have some suggestions.
I will add some extra inline comments for help. |
geooo109
reviewed
Jan 20, 2026
jaogoy
added a commit
to jaogoy/sqlglot
that referenced
this pull request
Jan 21, 2026
Depends on tobymao#6804 Please review/merge tobymao#6804 first. This PR only contains changes on top of that PR. - Import expression partitioning for MV. - Enabled ALTER TABLE … RENAME for StarRocks. - Emitted ORDER BY via CLUSTER BY for StarRocks outputs. - Added MV (REFRESH) properties handling for StarRocks materialized views. - And, tests updated/added for the new StarRocks behaviors. Signed-off-by: jaogoy <jaogoy@gmail.com>
This was referenced Jan 21, 2026
Collaborator
|
Hey @petrikoro 👋 Are you planning to take this to the finish line? |
Contributor
Author
Hi 👋 Sure, I plan to get back to PR tomorrow. Thanks for the suggestions @geooo109! |
Contributor
Author
Hi! Take a look at a477f75, did I get that right? |
Collaborator
|
@petrikoro thank you very much, will check it soon. |
geooo109
reviewed
Jan 23, 2026
Collaborator
geooo109
left a comment
There was a problem hiding this comment.
Nice work!! left some comments.
geooo109
approved these changes
Jan 26, 2026
jaogoy
added a commit
to jaogoy/sqlglot
that referenced
this pull request
Jan 28, 2026
Depends on tobymao#6804 Please review/merge tobymao#6804 first. This PR only contains changes on top of that PR. - Import expression partitioning for MV. - Enabled ALTER TABLE … RENAME for StarRocks. - Emitted ORDER BY via CLUSTER BY for StarRocks outputs. - Added MV (REFRESH) properties handling for StarRocks materialized views. - And, tests updated/added for the new StarRocks behaviors. Signed-off-by: jaogoy <jaogoy@gmail.com>
geooo109
pushed a commit
that referenced
this pull request
Jan 28, 2026
* Feat(starrocks)!: improve some starrocks properties generation Depends on #6804 Please review/merge #6804 first. This PR only contains changes on top of that PR. - Import expression partitioning for MV. - Enabled ALTER TABLE … RENAME for StarRocks. - Emitted ORDER BY via CLUSTER BY for StarRocks outputs. - Added MV (REFRESH) properties handling for StarRocks materialized views. - And, tests updated/added for the new StarRocks behaviors. Signed-off-by: jaogoy <jaogoy@gmail.com> * feat(starrocks)!: optimize the code according to review comments 1. move alterrename_sql to mysql 2. implement parse_refresh_property for starrocks 3. refine refresh property generatation Signed-off-by: jaogoy <jaogoy@gmail.com> * optimize code style Signed-off-by: jaogoy <jaogoy@gmail.com> * move RefreshProperty location into base generator Signed-off-by: jaogoy <jaogoy@gmail.com> * rebase code Signed-off-by: jaogoy <jaogoy@gmail.com> * modify the parentheses for partition Signed-off-by: jaogoy <jaogoy@gmail.com> --------- Signed-off-by: jaogoy <jaogoy@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #6803
Description
This PR adds comprehensive support for StarRocks partitioning syntax including:
PARTITION BY expr1, expr2): https://docs.starrocks.io/docs/table_design/data_distribution/expression_partitioning/PARTITION BY LIST (cols) (...)): https://docs.starrocks.io/docs/table_design/data_distribution/list_partitioning/PARTITION BY RANGE (cols) (PARTITION ... VALUES LESS THAN ...)): https://docs.starrocks.io/docs/table_design/data_distribution/dynamic_partitioning/#examplePARTITION BY RANGE (cols) (START ... END ... EVERY ...)): https://docs.starrocks.io/docs/table_design/data_distribution/dynamic_partitioning/#examplePreviously, multi-expression partitioning and LIST partitioning were not supported.
Examples
Expression-based partitioning:
LIST partitioning:
RANGE partitioning with explicit values:
RANGE partitioning with START/END/EVERY:
See more in
tests/dialects/test_starrocks.pyTesting
All syntax variations have been validated against a local StarRocks instance (tested on StarRocks 4.0.2 and 3.5.0).