Copilot commented on code in PR #2544:
URL: https://github.com/apache/phoenix/pull/2544#discussion_r3471124262
##########
phoenix-core-client/src/main/java/org/apache/phoenix/execute/UnionPlan.java:
##########
@@ -239,6 +239,11 @@ public ExplainPlan getExplainPlan() throws SQLException {
String abstractExplainPlan = "UNION ALL OVER " + this.plans.size() + "
QUERIES";
builder.setAbstractExplainPlan(abstractExplainPlan);
steps.add(abstractExplainPlan);
+ // Carry the requested EXPLAIN options down to each branch so every
participating scan renders
+ // the same disclosures (e.g. VERBOSE predicate-origin attribution) as the
driver scan.
+ for (QueryPlan plan : plans) {
+ plan.getContext().setExplainOptions(getContext().getExplainOptions());
+ }
Review Comment:
The propagation logic here is important for non-default EXPLAIN modes
(VERBOSE / REGIONS / FORMAT JSON), but existing explain tests appear to cover
UNION ALL only in plain mode. Adding an end-to-end test that runs a UNION ALL
(and/or a join) under ExplainOptions.VERBOSE and asserts that each branch/child
scan includes the VERBOSE-only disclosures (e.g., per-predicate "-- WHERE"
origin comments) would prevent regressions of this exact bug.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]