Skip to content

[Enhancement] Introduce SCHEDULE keyword as ASYNC synonym for MV refresh#72329

Merged
HangyuanLiu merged 1 commit into
StarRocks:mainfrom
Youngwb:imv-v1/schedule-keyword
Apr 29, 2026
Merged

[Enhancement] Introduce SCHEDULE keyword as ASYNC synonym for MV refresh#72329
HangyuanLiu merged 1 commit into
StarRocks:mainfrom
Youngwb:imv-v1/schedule-keyword

Conversation

@Youngwb

@Youngwb Youngwb commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Why I'm doing:

What I'm doing:

the trigger framework keyword for scheduled refresh is renamed to SCHEDULE. ASYNC is preserved as a parser-level synonym so existing scripts continue to work; SHOW CREATE displays the new SCHEDULE keyword.

Production:

  • Grammar: refreshSchemeDesc now accepts (ASYNC | SCHEDULE) as equivalent tokens for the scheduled refresh form. Both keywords are already declared in the lexer and listed as non-reserved.
  • AstBuilder.visitRefreshSchemeDesc: branch on ASYNC || SCHEDULE; both produce the same AsyncRefreshSchemeDesc.
  • MaterializedView.getMaterializedViewDdlStmt: emit "SCHEDULE" in place of "ASYNC" for MaterializedViewRefreshType.ASYNC. The persisted enum is unchanged; only the user-facing display is updated.

Tests:

  • Add a synonym test (testAsyncIsSynonymForScheduleAndShowCreatePrefers Schedule) covering both keywords in CREATE and asserting SHOW CREATE output uses SCHEDULE.
  • Update the parameterized refreshArgumentsList in ShowCreateMaterializedViewStmtTest from REFRESH ASYNC to REFRESH SCHEDULE so the SHOW CREATE round-trip assertion matches the new display.
  • Update testAlterRefreshScheme to translate ASYNC→SCHEDULE when comparing the SHOW CREATE output of an ALTER REFRESH ASYNC ... statement.
  • Update SQL integration R files where SHOW CREATE output appears (test_enable_mv, test_random_distribution) to expect SCHEDULE.

Fixes #issue

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • Parameter changes: default values, similar parameters but with different default values
  • Policy changes: use new policy to replace old one, functionality automatically enabled
  • Feature removed
  • Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function
    • This pr needs auto generate documentation
  • This is a backport pr

Bugfix cherry-pick branch check:

  • I have checked the version labels which the pr will be auto-backported to the target branch
    • 4.1
    • 4.0
    • 3.5
    • 3.4

Per the IMV V1 PRD, the trigger framework keyword for scheduled refresh
is renamed to SCHEDULE. ASYNC is preserved as a parser-level synonym so
existing scripts continue to work; SHOW CREATE displays the new SCHEDULE
keyword.

Production:
- Grammar: refreshSchemeDesc now accepts (ASYNC | SCHEDULE) as
  equivalent tokens for the scheduled refresh form. Both keywords are
  already declared in the lexer and listed as non-reserved.
- AstBuilder.visitRefreshSchemeDesc: branch on ASYNC || SCHEDULE; both
  produce the same AsyncRefreshSchemeDesc.
- MaterializedView.getMaterializedViewDdlStmt: emit "SCHEDULE" in place
  of "ASYNC" for MaterializedViewRefreshType.ASYNC. The persisted enum
  is unchanged; only the user-facing display is updated.

Tests:
- Add a synonym test (testAsyncIsSynonymForScheduleAndShowCreatePrefers
  Schedule) covering both keywords in CREATE and asserting SHOW CREATE
  output uses SCHEDULE.
- Update the parameterized refreshArgumentsList in
  ShowCreateMaterializedViewStmtTest from REFRESH ASYNC to
  REFRESH SCHEDULE so the SHOW CREATE round-trip assertion matches the
  new display.
- Update testAlterRefreshScheme to translate ASYNC→SCHEDULE when
  comparing the SHOW CREATE output of an ALTER REFRESH ASYNC ...
  statement.
- Update SQL integration R files where SHOW CREATE output appears
  (test_enable_mv, test_random_distribution) to expect SCHEDULE.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Youngwb <yangwenbo_mailbox@163.com>
@Youngwb Youngwb requested review from a team as code owners April 29, 2026 07:17
@github-actions github-actions Bot added the documentation Documentation changes label Apr 29, 2026
@github-actions github-actions Bot added the 4.1 label Apr 29, 2026
@CelerData-Reviewer

Copy link
Copy Markdown

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@github-actions

Copy link
Copy Markdown
Contributor

🌎 Translation Required?

All translation files are up to date.
Great job! No translation actions are required for this PR.

🕒 Last updated: Wed, 29 Apr 2026 07:24:09 GMT

@github-actions

Copy link
Copy Markdown
Contributor

[Java-Extensions Incremental Coverage Report]

pass : 0 / 0 (0%)

@github-actions

Copy link
Copy Markdown
Contributor

[FE Incremental Coverage Report]

pass : 6 / 6 (100.00%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 com/starrocks/catalog/MaterializedView.java 6 6 100.00% []

@github-actions

Copy link
Copy Markdown
Contributor

[BE Incremental Coverage Report]

pass : 0 / 0 (0%)

@HangyuanLiu HangyuanLiu merged commit 112df75 into StarRocks:main Apr 29, 2026
59 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

@Mergifyio backport branch-4.1

@github-actions github-actions Bot removed the 4.1 label Apr 29, 2026
@mergify

mergify Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

backport branch-4.1

✅ Backports have been created

Details

Cherry-pick of 112df75 has failed:

On branch mergify/bp/branch-4.1/pr-72329
Your branch is up to date with 'origin/branch-4.1'.

You are currently cherry-picking commit 112df75c36.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   docs/en/sql-reference/sql-statements/materialized_view/ALTER_MATERIALIZED_VIEW.md
	modified:   docs/en/sql-reference/sql-statements/materialized_view/CREATE_MATERIALIZED_VIEW.md
	modified:   docs/ja/sql-reference/sql-statements/materialized_view/ALTER_MATERIALIZED_VIEW.md
	modified:   docs/ja/sql-reference/sql-statements/materialized_view/CREATE_MATERIALIZED_VIEW.md
	modified:   docs/zh/sql-reference/sql-statements/materialized_view/ALTER_MATERIALIZED_VIEW.md
	modified:   docs/zh/sql-reference/sql-statements/materialized_view/CREATE_MATERIALIZED_VIEW.md
	modified:   fe/fe-core/src/main/java/com/starrocks/catalog/MaterializedView.java
	modified:   fe/fe-core/src/main/java/com/starrocks/sql/parser/AstBuilder.java
	modified:   fe/fe-core/src/test/java/com/starrocks/analysis/AlterMaterializedViewTest.java
	modified:   fe/fe-core/src/test/java/com/starrocks/analysis/ShowCreateMaterializedViewStmtTest.java

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   fe/fe-grammar/src/main/antlr/com/starrocks/grammar/StarRocks.g4

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@Youngwb Youngwb deleted the imv-v1/schedule-keyword branch April 29, 2026 09:32
Youngwb added a commit that referenced this pull request Apr 29, 2026
…esh (#72329)

Signed-off-by: Youngwb <yangwenbo_mailbox@163.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
(cherry picked from commit 112df75)
wanpengfei-git pushed a commit that referenced this pull request Apr 29, 2026
…esh (backport #72329) (#72344)

Signed-off-by: Youngwb <yangwenbo_mailbox@163.com>
Co-authored-by: Youngwb <yangwenbo_mailbox@163.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Hyper-FF pushed a commit to Hyper-FF/starrocks that referenced this pull request Apr 30, 2026
…esh (StarRocks#72329)

Signed-off-by: Youngwb <yangwenbo_mailbox@163.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
robd003 pushed a commit to robd003/starrocks that referenced this pull request May 6, 2026
…esh (StarRocks#72329)

Signed-off-by: Youngwb <yangwenbo_mailbox@163.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4.1-merged documentation Documentation changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants