github-actions[bot] commented on code in PR #62527:
URL: https://github.com/apache/doris/pull/62527#discussion_r3087644413
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/exploration/mv/HyperGraphComparator.java:
##########
@@ -278,6 +288,19 @@ private boolean tryEliminateNodesAndEdge() {
&&
LongBitmap.getCardinality(reservedShouldEliminatedViewNodes) == 0;
}
+ static long getFilterInputNodes(HyperGraph hyperGraph, FilterEdge
filterEdge) {
Review Comment:
`getFilterInputNodes()` now treats slot-free predicates as if they belonged
to no node at all. That makes the new safety check unsound for inner-join
elimination.
For example, a view side like:
```sql
SELECT t1.id
FROM t1
INNER JOIN (SELECT * FROM t2 WHERE 1 = 0) t2f
ON t1.id = t2f.id
```
still has a filter that changes which `t1` rows survive, but
`filterEdge.getInputSlots()` is empty here, so this helper returns `0`. After
that:
- `tryEliminateNodesAndEdge()` no longer marks the filter as unsafe for the
removed side, and
- `isLogicCompatible()` also skips the residual `FilterEdge` because it uses
the same helper in the overlap check.
That can make `SELECT t1.id FROM t1` look compatible with a view that is
actually empty. This helper needs to treat slot-free predicates as belonging to
the whole filter subtree, not to "no nodes".
##########
fe/fe-core/src/test/java/org/apache/doris/nereids/rules/exploration/mv/EliminateJoinTest.java:
##########
@@ -100,6 +103,58 @@ void testLOJWithUK() throws Exception {
dropConstraint("alter table T2 drop constraint uk");
}
+ @Test
Review Comment:
The added tests only cover rejection paths plus the helper method. They
never assert the positive regression described in the PR body: a unique right
side with `otherJoinConjuncts` inside the `LEFT JOIN ... ON ...` clause should
now match `SELECT ... FROM t1`.
Because this patch is specifically about relaxing `otherJoinConjuncts`, we
still need a direct end-to-end regression here, e.g. the `LEFT JOIN t2 ON t1.id
= t2.id AND t2.id = 1` shape from the PR description.
--
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]