Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/19827#discussion_r153401812
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/GenerateUnsafeProjection.scala
---
@@ -49,25 +49,18 @@ object GenerateUnsafeProjection extends
CodeGenerator[Seq[Expression], UnsafePro
input: String,
fieldTypes: Seq[DataType],
bufferHolder: String): String = {
+ // Puts `input` in a local variable to avoid to re-evaluate it if it's
a statement.
+ val tmpInput = ctx.freshName("tmpInput")
--- End diff --
Actually I add it back as it fixes a bug which is exposed by
https://github.com/apache/spark/pull/19827/files#diff-90b107e5c61791e17d5b4b25021b89fdR168
.
Previously we never do the methods splitting here in whole stage codegen
path. Now I released the constraint and need this fix, to avoid putting code
statement in method parameter list.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]