Skip to content

Commit 0bb8c0e

Browse files
committed
More comment.
1 parent 413707d commit 0bb8c0e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

sql/core/src/main/scala/org/apache/spark/sql/execution/WholeStageCodegenExec.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,12 @@ trait CodegenSupport extends SparkPlan {
152152

153153
// Under certain conditions, we can put the logic to consume the rows of this operator into
154154
// another function. So we can prevent a generated function too long to be optimized by JIT.
155+
// The conditions:
156+
// 1. The parent uses all variables in output. we can't defer variable evaluation when consume
157+
// in another function.
158+
// 2. The output variables are not empty. If it's empty, we don't bother to do that.
159+
// 3. We don't use row variable. The construction of row uses deferred variable evaluation. We
160+
// can't do it.
155161
val requireAllOutput = output.forall(parent.usedInputs.contains(_))
156162
val consumeFunc =
157163
if (row == null && outputVars.nonEmpty && requireAllOutput) {

0 commit comments

Comments
 (0)