Uh oh!
There was an error while loading. Please reload this page.
PHOENIX-7936 EXPLAIN the user's projection on server-driven mutation inner plans - #2545
Conversation
…inner plans Co-authored-by: Claude Opus 4.8[1m] <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR improves EXPLAIN (VERBOSE) output for server-side UPSERT SELECT and DELETE by preventing the internal SELECT COUNT(1) rewrite (used only to compute mutation row counts) from leaking into the inner scan’s reported PROJECT/serverProject, and instead surfacing a user-facing projection.
Changes:
- Factored VERBOSE
PROJECTrendering into reusableExplainTable.projectedColumnNames(RowProjector). - Added
ExplainTable.overrideMutationProject(...)to rewrite the inner plan’sPROJECTline andserverProjectattributes for mutation plans. - Wired the rewrite into server-side mutation explain plans in
UpsertCompilerandDeleteCompiler.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| phoenix-core-client/src/main/java/org/apache/phoenix/iterate/ExplainTable.java | Factors projection-name rendering and adds a helper to override mutation PROJECT/serverProject to be user-facing. |
| phoenix-core-client/src/main/java/org/apache/phoenix/compile/UpsertCompiler.java | Applies the mutation projection override so VERBOSE explain reflects the user’s SELECT projection for server-side UPSERT SELECT. |
| phoenix-core-client/src/main/java/org/apache/phoenix/compile/DeleteCompiler.java | Applies the mutation projection override so VERBOSE explain reflects the delete’s row-identity projection rather than the internal count. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…inner plans (#2545) Co-authored-by: Claude Opus 4.8[1m] <noreply@anthropic.com>
…inner plans (apache#2545) Co-authored-by: Claude Opus 4.8[1m] <noreply@anthropic.com>
Server-side
UPSERT SELECTandDELETEcompile their inner scan as an aggregatingSELECT COUNT(1)whose count reports how many rows were touched. UnderEXPLAIN (VERBOSE)that internal rewrite leaked as a misleadingPROJECT COUNT(1)line (andserverProject: ["COUNT(1)"]in JSON) on the inner scan rather than describing the mutation.ExplainTablefactors the per-scanPROJECTnaming into a reusable staticprojectedColumnNames(RowProjector)and addsoverrideMutationProject, which rewrites theserverProjectattribute with the user-facing projection forUPSERT SELECTandDELETE.Co-authored-by: Claude Opus 4.8[1m] noreply@anthropic.com