cloud-fan commented on a change in pull request #29975:
URL: https://github.com/apache/spark/pull/29975#discussion_r503051694
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodeGenerator.scala
##########
@@ -1761,16 +1772,21 @@ object CodeGenerator extends Logging {
case ref: BoundReference if ctx.currentVars != null &&
ctx.currentVars(ref.ordinal) != null =>
- val ExprCode(_, isNull, value) = ctx.currentVars(ref.ordinal)
- collectLocalVariable(value)
- collectLocalVariable(isNull)
+ val exprCode = ctx.currentVars(ref.ordinal)
+ // If the referred variable is not evaluated yet.
+ if (exprCode.code != EmptyBlock) {
+ exprCodesNeedEvaluate += exprCode.copy()
Review comment:
Sorry I was wrong, the copy here is necessary.
----------------------------------------------------------------
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]