yujun777 commented on code in PR #70516:
URL: https://github.com/apache/doris/pull/70516#discussion_r4639674645


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/processor/post/RuntimeFilterPushDownVisitor.java:
##########
@@ -308,6 +318,25 @@ && canPushThroughJoinChild(join, false, ctx)) {
                 }
                 if (newTarget != null && newTarget.getInputSlots().size() == 1
                         && !newTarget.equals(ctx.srcExpr)) {
+                    if (expandByOuterJoin) {

Review Comment:
   [P1] Stop expanded filters at projections with non-movable functions
   
   The direct-column guard still admits `R.k` when a different expression in 
the same projection must run before filtering. For example, consider:
   
   ```sql
   SELECT l.k, r.checked
   FROM L l
   LEFT JOIN (SELECT k, assert_true(v > 0, 'bad') AS checked FROM R) r
     ON l.k = r.k
   JOIN E e ON l.k = e.k
   ```
   
   With INT keys, `L={1,2}`, `E={2}`, and `R={(1,0),(2,1)}`, keep the join 
order and use an IN runtime filter that the scan waits for. Before expansion, 
the lower join's build-side projection evaluates `assert_true` on `(1,0)` and 
raises `bad`. With expansion, `visitPhysicalProject` pushes `RF({2})` through 
the projection to the scan on `R.k`. The scan drops `(1,0)` before the 
projection evaluates it, so the query can succeed.
   
   Could we apply the existing `containsNoneMovableFunction()` guard in 
`visitPhysicalProject` and extend the row-count regression suite to verify that 
both settings of the expansion flag raise `bad`? [Existing predicate pushdown 
guard](https://github.com/apache/doris/blob/3a5d3e7f5c142bcba1e52ddbd1cea2c4cad6c12a/fe/fe-core/src/main/java/org/apache/doris/nereids/processor/post/PushDownFilterThroughProject.java#L35-L50)



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