tokoko commented on PR #58506:
URL: https://github.com/apache/spark/pull/58506#issuecomment-6144415128

   @cloud-fan I looked into it. The reuse loss can happen, but I think it's too 
unlikely to change the overall picture.
   
   It needs several false full outer joins whose broadcast sides are the same 
subplan, and that subplan must have no exchange of its own (a shuffle inside it 
is still reused). Even then, the plan being replaced is not cheap: 
BroadcastNestedLoopJoinExec executes the streamed side twice per full outer 
join and evaluates the condition for every row pair, even when it is false. The 
broadcast side is likely small, so the extra read usually won't matter. I'd 
really have to engineer a scenario where the broadcast side depends on some 
exceptionally expensive computation for the lost reuse to outweigh the gain.
   
   Lastly, the existing false-condition LeftOuter/RightOuter rewrites in this 
rule drop the broadcast exchange in the same way, so this follows the rule's 
current behavior.
   
   I can benchmark a few scenarios if you think it's worthwhile, though I'm not 
sure how much it would add.


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