Skip to content

Conversation

@jaogoy
Copy link
Contributor

@jaogoy jaogoy commented Jan 21, 2026

Depends on #6804.
Please review/merge #6804 first.
This PR contains changes on top of that PR. And you can review the diff only.

  • Import expression partitioning for MV.
  • Enabled ALTER TABLE … RENAME for StarRocks. (Moved alterrename_sql from Doris into MySQL, because it's the same for them all.)
  • 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.

@jaogoy
Copy link
Contributor Author

jaogoy commented Jan 21, 2026

I create this PR to replace #6737, which is closed by mistake.
And it depends on #6804, which also supports partitioning parse and generation, submitted by @petrikoro.

Please have a review. Thanks.

cc @georgesittas @VaggelisD

exp.RollupProperty: exp.Properties.Location.POST_SCHEMA,
exp.PartitionByListProperty: exp.Properties.Location.POST_SCHEMA,
exp.PartitionedByProperty: exp.Properties.Location.POST_SCHEMA,
exp.RefreshTriggerProperty: exp.Properties.Location.POST_SCHEMA,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks like this is the case for Doris as well, does MySQL have this property? Otherwise, we can move both Doris & Starrocks's to MySQL and have it inherited

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. For MySQL, it doesn't support MV.
  2. There are different between Doris and StarRocks for the REFRESH clause, both for the syntax and keywords.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Right, I meant that this line is also true in Doris so we can move the POST_SCHEMA to either MySQL's generator or the base generator instead of duplicating it in both Doris & Starrocks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I'll move it to the base generator. (It's not proper for MySQL.)

exp.RollupProperty: exp.Properties.Location.POST_SCHEMA,
exp.PartitionByListProperty: exp.Properties.Location.POST_SCHEMA,
exp.PartitionedByProperty: exp.Properties.Location.POST_SCHEMA,
exp.RefreshTriggerProperty: exp.Properties.Location.POST_SCHEMA,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Right, I meant that this line is also true in Doris so we can move the POST_SCHEMA to either MySQL's generator or the base generator instead of duplicating it in both Doris & Starrocks

@geooo109
Copy link
Collaborator

geooo109 commented Jan 26, 2026

@jaogoy can you rebase on top of main ? I merged #6804 + refactored it.

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>
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>
Signed-off-by: jaogoy <jaogoy@gmail.com>
Signed-off-by: jaogoy <jaogoy@gmail.com>
Signed-off-by: jaogoy <jaogoy@gmail.com>
@jaogoy jaogoy force-pushed the improv.sr-based-on-pr-6804 branch from 41194d5 to b0df46e Compare January 28, 2026 03:43
@jaogoy
Copy link
Contributor Author

jaogoy commented Jan 28, 2026

@jaogoy can you rebase on top of main ? I merged #6804 + refactored it.

@geooo109 @VaggelisD I've rebased the code, and solve the conflict. You can have a look again. thanks.

Signed-off-by: jaogoy <jaogoy@gmail.com>
@geooo109
Copy link
Collaborator

geooo109 commented Jan 28, 2026

@jaogoy I will check it, thank you.

For the PARTITION BY with parentheses see: #6804 (comment)

We can parse them but we generate without PARTITION BY Starrocks

edit: i will refactor it to generate parentheses by default, in order to support the superset.

@geooo109
Copy link
Collaborator

geooo109 commented Jan 28, 2026

@jaogoy can you fix the styling ?

edit: I will merge, fix style and refactor, thanks for the PR!

@geooo109 geooo109 merged commit c6bfe61 into tobymao:main Jan 28, 2026
3 of 9 checks passed
@jaogoy
Copy link
Contributor Author

jaogoy commented Jan 29, 2026

@jaogoy I will check it, thank you.

For the PARTITION BY with parentheses see: #6804 (comment)

We can parse them but we generate without PARTITION BY Starrocks

@geooo109 The StarRocks docs can't reflect all the real behavior. I've tested the creation on v3.5, only DUPLICATE KEY tables can be created without parentheses when using column only partitioning. And I don't know whether they will fix it.
So, when used by SQLMesh, it can't create primary key tables with column only partitioning without parentheses.

@geooo109
Copy link
Collaborator

geooo109 commented Jan 29, 2026

@jaogoy If we always generate by default parentheses, it will be correct right ?

@jaogoy
Copy link
Contributor Author

jaogoy commented Jan 30, 2026

@jaogoy If we always generate by default parentheses, it will be correct right ?

Yes, for columns only partitioning, it will be correct for all cases.

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