cloud-fan commented on PR #45802:
URL: https://github.com/apache/spark/pull/45802#issuecomment-2101762336

   I've been thinking hard about it. Filter pushdown should always be 
beneficial if we don't duplicate expressions, and the new `With` expression can 
avoid expression duplication.
   
   So my proposal is: when we push down filter, and we are about to duplicate 
some expressions, let's use `With` to avoid it. At the end of the optimizer, we 
run the rule `RewriteWithExpression` to rewrite `With` and pull out common 
expressions into a `Project` below. Data source pushdown rule doesn't require 
the scan node to be the direct child of `Filter`, so everything should work as 
before.


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