viirya commented on a change in pull request #32980:
URL: https://github.com/apache/spark/pull/32980#discussion_r660968597
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodeGenerator.scala
##########
@@ -76,24 +76,34 @@ 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.
*/
-case class SubExprEliminationState(isNull: ExprValue, value: ExprValue)
+case class SubExprEliminationState(
+ eval: ExprCode,
+ children: Seq[SubExprEliminationState])
+
+object SubExprEliminationState {
+ def apply(
+ eval: ExprCode,
+ children: Seq[SubExprEliminationState] = Seq.empty):
SubExprEliminationState = {
Review comment:
Added `def apply(eval: ExprCode)`.
--
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]