Github user kiszk commented on a diff in the pull request:
https://github.com/apache/spark/pull/19811#discussion_r156877455
--- 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 --
We want to keep order of initialization since they have dependency (`a =
new UnsafeRow(...)`, and then `b = new BufferHolder(a, ...);`).
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]