cloud-fan commented on code in PR #57703:
URL: https://github.com/apache/spark/pull/57703#discussion_r3718485471


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/ExpandExec.scala:
##########
@@ -137,6 +137,10 @@ case class ExpandExec(
      *
      * We use a for loop here so we only includes one copy of the consume code 
and avoid code
      * size explosion.
+     *
+     * In addition, common subexpressions shared by the branch expressions 
(e.g. an expensive
+     * condition repeated in many branches) are evaluated only once per input 
row, before the

Review Comment:
   Please qualify this with `when subexpression elimination is enabled`. The 
disabled branch creates an empty CSE state, so repeated expressions are still 
evaluated once per Expand branch.



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