nsivarajan commented on code in PR #63974:
URL: https://github.com/apache/doris/pull/63974#discussion_r3594415222


##########
fe/fe-core/src/main/java/org/apache/doris/statistics/query/QueryStatsRecorder.java:
##########
@@ -351,6 +443,36 @@ private static void walkPlan(Plan plan,
                                 exprIdToColName.put(ne.getExprId(), colName);
                             }
                         }
+                    } else if (inputSlots.size() > 1) {
+                        // Defer to avoid misclassifying 
PushDownExpressionsInHashCondition
+                        // join-key projects as queryHit; parent filter/join 
expands as filterHit,
+                        // root output loop expands as queryHit.
+                        aggOutputToInputSlots.put(ne.getExprId(), inputSlots);
+                    }
+                }
+            }
+        }
+    }
+
+    /** Shared by PhysicalSetOperation and PhysicalRecursiveUnion — both 
expose the same
+     *  getRegularChildrenOutputs() contract and need identical queryHit 
recording logic. */
+    private static void recordSetOpChildrenOutputs(
+            List<List<SlotReference>> childrenOutputs,
+            Map<ExprId, PhysicalOlapScan> exprIdToScan,
+            Map<ExprId, String> exprIdToColName,
+            Map<String, StatsDelta> deltas) {
+        for (List<SlotReference> childOutput : childrenOutputs) {
+            for (SlotReference sr : childOutput) {
+                PhysicalOlapScan sourceScan = exprIdToScan.get(sr.getExprId());

Review Comment:
   Fixed — recordSetOpChildrenOutputs now resolves branch output slots through 
the shared resolver instead of a direct scan-map check, covered by 
testSetOperationComputedBranchColumnRecordsQueryHit.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to