Skip to content

Commit 7462a55

Browse files
committed
Address comment.
1 parent 27145ae commit 7462a55

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/GenerateOrdering.scala

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,16 +149,14 @@ object GenerateOrdering extends CodeGenerator[Seq[SortOrder], Ordering[InternalR
149149
"""
150150
}.mkString
151151
})
152+
ctx.currentVars = oldCurrentVars
153+
ctx.INPUT_ROW = oldInputRow
152154
// make sure INPUT_ROW is declared even if splitExpressions
153155
// returns an inlined block
154-
val finalCode = s"""
155-
|InternalRow ${ctx.INPUT_ROW} = null;
156+
s"""
157+
|InternalRow $inputRow = null;
156158
|$code
157159
""".stripMargin
158-
// Restore original currentVars and INPUT_ROW.
159-
ctx.currentVars = oldCurrentVars
160-
ctx.INPUT_ROW = oldInputRow
161-
finalCode
162160
}
163161

164162
protected def create(ordering: Seq[SortOrder]): BaseOrdering = {

0 commit comments

Comments
 (0)