You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "terrymanu (via GitHub)" <gi...@apache.org> on 2026/08/23 13:48:03 UTC

[PR] Support parsing Doris REFRESH MATERIALIZED VIEW syntax [shardingsphere]

terrymanu opened a new pull request, #39582:
URL: https://github.com/apache/shardingsphere/pull/39582

   - Add REFRESH MATERIALIZED VIEW <mv-name> (AUTO | COMPLETE | PARTITIONS) grammar rule to the Doris dialect
   - Add DorisRefreshMaterializedViewStatement and visitRefreshMaterializedView to extract mv name, refresh type and partition names
   - Add parser IT cases covering the AUTO, COMPLETE and PARTITIONS variants from issue #31457
   
   Fixes #31457


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support parsing Doris REFRESH MATERIALIZED VIEW syntax [shardingsphere]

Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu merged PR #39582:
URL: https://github.com/apache/shardingsphere/pull/39582


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support parsing Doris REFRESH MATERIALIZED VIEW syntax [shardingsphere]

Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu commented on PR #39582:
URL: https://github.com/apache/shardingsphere/pull/39582#issuecomment-5386360650

   ### Result
   
   **Review Result: Mergeable**
   
   PR #39582 adds `REFRESH MATERIALIZED VIEW` parsing support to the Doris dialect. The grammar matches the official documentation verbatim, the wiring is complete, and the 3 parser IT cases correspond exactly to the official examples; the three-lens discovery and convergence pass found no candidate that passes the Finding Proof Gate as a blocker.
   
   ### Evidence
   
   - **Official syntax alignment**: The official Apache Doris syntax is `REFRESH MATERIALIZED VIEW <mv_name> {<partitionSpec> | COMPLETE | AUTO}`, where `mv_name` is defined as a plain identifier (no database-qualified form) and no other clause variants exist (doris.apache.org/docs/dev/sql-manual/sql-statements/table-and-view/async-materialized-view/REFRESH-MATERIALIZED-VIEW/). The PR rule `refreshMaterializedView : REFRESH MATERIALIZED VIEW name (partitionSpec | refreshMethod)` matches it exactly and reuses the existing `refreshMethod` (COMPLETE | AUTO), `name`, and `identifierList` rules.
   - **Ambiguity and regression**: The existing `refresh` rule (`parser/sql/engine/dialect/doris/src/main/antlr4/imports/doris/DALStatement.g4:929`) only accepts LDAP/CATALOG/DATABASE/TABLE after REFRESH, so its second token never intersects the new rule — no parse ambiguity; both new rules sit inside DORIS ADDED markers, consistent with the MySQL trunk/branch convention.
   - **Dialect family**: The MySQL trunk has no REFRESH statement and MariaDB has no corresponding rule; the root cause is Doris-specific, so no trunk or sibling-dialect sync is owed.
   - **Dispatch registration**: `SQLVisitorRule.java` adds `DORIS_REFRESH_MATERIALIZED_VIEW("RefreshMaterializedView", DDL)`; the prefixed constant name correctly avoids the `REFRESH_MATERIALIZED_VIEW` constant already taken by PostgreSQL (consistent with the `DORIS_DROP_FUNCTION`/`DORIS_ALTER_SYSTEM` precedent).
   - **Field extraction and assertions**: The visitor extracts mvName, the AUTO/COMPLETE flags, and the partition name list via `IdentifierValue`; the IT assertions cover all fields — a wrong field extraction or a dropped partition would fail the cases.
   - **Local verification** (head `bc75c1f0`; local file list matches GitHub 11/11): rerun of `InternalDorisParserIT` — **Tests run: 1361, Failures: 0, Errors: 0** (exit 0); compile, spotless, and checkstyle on identical content passed earlier (exit 0).
   - **Disproved or classified candidates**: ① "should support db.mv qualified names" — withdrawn, since the official docs define mv_name as a plain identifier; ② "assertions only check positive flags" — non-blocking, AUTO/COMPLETE exclusivity is grammar-enforced (`refreshMethod: COMPLETE | AUTO`) and matches the assert style of merged #39552; ③ the issue #31457 checkbox corrections (uncheck the wrongly checked `REFRESH, MATERIALIZED, VIEW` row, mark `CLEAN, PROFILE` invalid) are issue-side bookkeeping, outside this PR's code scope.
   
   ### Coverage
   
   - Reviewed head: `bc75c1f006e509df9e799acb19ff41c3684c57e2` (base `3eefbf7f146`, merge-base identical; the local `git diff` file list matches GitHub `/pulls/39582/files` 11/11).
   - Behavior clusters: 2 (grammar and statement modeling: 5 files; parser IT coverage: 6 files); all 11 authoritative files registered with risk axes marked; no churn-only files.
   - Completed the three discovery lenses (root cause/behavior, blast radius/contracts, tests/runtime) plus a latest-head convergence pass with 0 new candidates; the review ledger validated and was cleaned up.
   - Official documentation: the Doris dev REFRESH-MATERIALIZED-VIEW page (the old Utility-Statements path was reorganized; the current URL confirmed via the sitemap).
   - This is a Code Correctness Review: the result covers code scope only; GitHub Actions/CI state was not queried or awaited.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org