srowen commented on a change in pull request #27523: [SPARK-30772][ML][SQL]
avoid tuple assignment because it will circumvent the transient tag
URL: https://github.com/apache/spark/pull/27523#discussion_r377358714
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/higherOrderFunctions.scala
##########
@@ -478,11 +482,13 @@ case class ArrayFilter(
}
}
- @transient lazy val (elementVar, indexVar) = {
+ @transient private lazy val tuple = {
val LambdaFunction(_, (elementVar: NamedLambdaVariable) +: tail, _) =
function
val indexVar = tail.headOption.map(_.asInstanceOf[NamedLambdaVariable])
(elementVar, indexVar)
}
+ @transient lazy val elementVar = tuple._1
Review comment:
Hm, this pattern is a little ugly / adds extra overhead, but might be
necessary vs just referencing "elementIndexVar._1" later in the code or
something similar.
----------------------------------------------------------------
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]