You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/02/10 22:40:57 UTC

[GitHub] [spark] srowen commented on a change in pull request #27523: [SPARK-30772][ML][SQL] avoid tuple assignment because it will circumvent the transient tag

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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org