File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
sql/core/src/main/scala/org/apache/spark/sql/execution Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -145,11 +145,12 @@ case class ExpandExec(
145
145
// Part 1: declare variables for each column
146
146
// If a column has the same value for all output rows, then we also generate its computation
147
147
// right after declaration. Otherwise its value is computed in the part 2.
148
+ lazy val attributeSeq : AttributeSeq = child.output
148
149
val outputColumns = output.indices.map { col =>
149
150
val firstExpr = projections.head(col)
150
151
if (sameOutput(col)) {
151
152
// This column is the same across all output rows. Just generate code for it here.
152
- BindReferences .bindReference(firstExpr, child.output ).genCode(ctx)
153
+ BindReferences .bindReference(firstExpr, attributeSeq ).genCode(ctx)
153
154
} else {
154
155
val isNull = ctx.freshName(" isNull" )
155
156
val value = ctx.freshName(" value" )
@@ -168,7 +169,6 @@ case class ExpandExec(
168
169
// Part 2: switch/case statements
169
170
val cases = projections.zipWithIndex.map { case (exprs, row) =>
170
171
var updateCode = " "
171
- val attributeSeq : AttributeSeq = child.output
172
172
for (col <- exprs.indices) {
173
173
if (! sameOutput(col)) {
174
174
val ev = BindReferences .bindReference(exprs(col), attributeSeq).genCode(ctx)
You can’t perform that action at this time.
0 commit comments