houzhizhen opened a new pull request, #43397:
URL: https://github.com/apache/spark/pull/43397

   ### What changes were proposed in this pull request?
   All children of If should be eliminate common  expression.
   
   
   ### Why are the changes needed?
   There are three children in If: predicate, trueValue and falseValue.
   
   There are two execution paths. 1: predicate and trueValue. 2: predicate and 
falseValue.
   
   There are three conbinations of possible common subexpression. 1: predicate 
and trueValue. 2: predicate and falseValue. 3: trueValue and falseValue.
   
   So if all possible common subexpression be eliminated, there is 2 3 
possibility to improve the performance. For example, if there is common 
subexpression in predicate and falseValue, and common subexpression is executed 
only once, and it can improve the performance. Only there is common 
subexpression in trueValue and falseValue will not improve the performance and 
it will not draw back the performance, since whether trueValue and falseValue 
will be executed.
   
   ### Does this PR introduce _any_ user-facing change?
   No
   
   
   ### How was this patch tested?
   Existing testcase
   
   
   ### Was this patch authored or co-authored using generative AI tooling?
   no
   


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