Github user kiszk commented on a diff in the pull request:
https://github.com/apache/spark/pull/19811#discussion_r156880726
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/GenerateUnsafeProjection.scala
---
@@ -318,13 +316,12 @@ object GenerateUnsafeProjection extends
CodeGenerator[Seq[Expression], UnsafePro
case _ => true
}
- val result = ctx.freshName("result")
- ctx.addMutableState("UnsafeRow", result, s"$result = new
UnsafeRow(${expressions.length});")
+ val result = ctx.addMutableState("UnsafeRow", "result",
+ v => s"$v = new UnsafeRow(${expressions.length});", inline = true)
--- End diff --
Or, is it better to introduce another flag to keep order of initialization
even when compacted? e.g. `keepInitializationOrder`
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]