Github user rednaxelafx commented on a diff in the pull request:
https://github.com/apache/spark/pull/22976#discussion_r233771269
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/GenerateOrdering.scala
---
@@ -68,62 +68,55 @@ object GenerateOrdering extends
CodeGenerator[Seq[SortOrder], Ordering[InternalR
genComparisons(ctx, ordering)
}
+ /**
+ * Creates the variables for ordering based on the given order.
+ */
+ private def createOrderKeys(
+ ctx: CodegenContext,
+ row: String,
+ ordering: Seq[SortOrder]): Seq[ExprCode] = {
+ ctx.INPUT_ROW = row
+ // to use INPUT_ROW we must make sure currentVars is null
+ ctx.currentVars = null
--- End diff --
I thought about making the same suggestion, but on a second thought it's
fine to just leave it here as well. The overhead isn't gonna be high, but it's
nice to see how the `ctx.INPUT_ROW` and `ctx.currentVars` interact in adjacent
lines.
So I'm okay either way (as-is or with @viirya 's suggestion)
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]