github-actions[bot] commented on code in PR #62527:
URL: https://github.com/apache/doris/pull/62527#discussion_r3088441651


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/exploration/mv/HyperGraphComparator.java:
##########
@@ -278,6 +297,23 @@ private boolean tryEliminateNodesAndEdge() {
                 && 
LongBitmap.getCardinality(reservedShouldEliminatedViewNodes) == 0;
     }
 
+    static long getFilterInputNodes(HyperGraph hyperGraph, FilterEdge 
filterEdge) {
+        // FilterEdge referenceNodes is the whole child subtree. Use input 
slots to find the nodes
+        // actually referenced by predicates, otherwise preserved-side filters 
above LOJ look unsafe.
+        // Slot-free predicates still filter the whole child subtree, e.g. 
WHERE 1 = 0.
+        Set<Slot> inputSlots = filterEdge.getInputSlots();
+        if (inputSlots.isEmpty()) {
+            return filterEdge.getSubTreeNodes();
+        }
+        long inputNodes = LongBitmap.newBitmap();

Review Comment:
    strips  nodes and stores aliases in , so  only contains the base-node 
slots. For a filter above a projected subtree, e.g. ,  returns  here even 
though the filter still depends on the eliminated right node. That means the 
new relaxation still rejects this safe LOJ case, and the same hole can also 
miss unsafe nested filters above join results. Please resolve filter inputs 
through projection lineage / alias mapping before using them in the elimination 
check, and add a projected-alias test.



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