viirya commented on a change in pull request #32980:
URL: https://github.com/apache/spark/pull/32980#discussion_r656395813
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodeGenerator.scala
##########
@@ -76,24 +76,26 @@ object ExprCode {
/**
* State used for subexpression elimination.
*
- * @param isNull A term that holds a boolean value representing whether the
expression evaluated
- * to null.
- * @param value A term for a value of a common sub-expression. Not valid if
`isNull`
- * is set to `true`.
+ * @param eval The source code for evaluating the subexpression.
+ * @param children The sequence of subexpressions as the children expressions.
Before
+ * evaluating this subexpression, we should evaluate all
children
+ * subexpressions first. This is used if we want to
selectively evaluate
+ * particular subexpressions, instead of all at once. In the
case, we need
+ * to make sure we evaluate all children subexpressions too.
Review comment:
Not exactly. We need to return child subexpressions first. So we can
make sure child subexpression is codegen-ed and put into the map before parent
subexpression. When we want to codegen parent subexpression, it can look up the
child subexpression and put it as child of the parent.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]