HeartSaVioR commented on a change in pull request #26173: [SPARK-29503][SQL]
Copy result row from RowWriter in GenerateUnsafeProjection when the expression
is lambdaFunction in MapObject
URL: https://github.com/apache/spark/pull/26173#discussion_r336758324
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/GenerateUnsafeProjection.scala
##########
@@ -310,8 +312,19 @@ object GenerateUnsafeProjection extends
CodeGenerator[Seq[Expression], UnsafePro
|$evalSubexpr
|$writeExpressions
""".stripMargin
+
+ val runInsideLoop = expressions.exists {
+ case _: LambdaVariable => true
+ case _ => false
+ }
+ val extractValueCode = if (runInsideLoop) {
+ s"$rowWriter.getRow().copy()"
+ } else {
+ s"$rowWriter.getRow()"
+ }
Review comment:
I'm not an expert on SQL area (limited knowledge) so I'm not sure this is
only one path - I'd feel safe if experts in SQL area jump in and review the
approach. If we are uncertain and don't feel safe to fix for discovered case, I
may need to make more change.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]