[BugFix] Restore SHOW CREATE MATERIALIZED VIEW for sync MVs (backport #73396)#73493
Conversation
Signed-off-by: Kevin Cai <kevin.cai@celerdata.com> (cherry picked from commit 4e35d9d) # Conflicts: # fe/fe-core/src/main/java/com/starrocks/qe/ShowExecutor.java
|
Cherry-pick of 4e35d9d has failed: 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 |
|
@mergify[bot]: Backport conflict, please reslove the conflict and resubmit the pr |
|
@copilot help to resolve the backport code conflict in single commit. |
Agent-Logs-Url: https://github.com/StarRocks/starrocks/sessions/69524445-236d-4fa9-8751-e5687e623fb6 Co-authored-by: kevincai <771299+kevincai@users.noreply.github.com>
Head branch was pushed to by a user without write access
Agent-Logs-Url: https://github.com/StarRocks/starrocks/sessions/69524445-236d-4fa9-8751-e5687e623fb6 Co-authored-by: kevincai <771299+kevincai@users.noreply.github.com>
Resolved the backport conflict in ShowExecutor and fixed the related test compile issue on branch-4.0; targeted FE validation is passing on 2a720f0. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Sync MVs are mv indexes inside an OLAP table and are not registered as separate Tables in Database.idToTable / nameToTable. Since #43162 ("temporary table part-1") replaced the lookup in
showCreateInternalCatalogTable with MetaUtils.getSessionAwareTable, which throws SemanticException on miss, the existing fallback that scanned OLAP tables for a matching mv index has been unreachable - SHOW CREATE MATERIALIZED VIEW <sync_mv> has been failing with "Table ... is not found".
Catch SemanticException from the lookup and route MV-typed queries to a new findSyncMaterializedViewCreateStmt helper that performs the scan under DB READ (the indexNameToMetaId / indexMetaIdToMeta maps are HashMap-backed and mutated by ALTER, so the scan needs DB-wide exclusion). Non-MV queries rethrow the original "table not found" error unchanged.
Why I'm doing:
What I'm doing:
Fixes #issue
What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check:
This is an automatic backport of pull request #73396 done by [Mergify](https://mergify.com).