spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [spark] nvander1 commented on a change in pull request #25666: [SPARK-28962][SQL] Provide index argument to filter lambda functions
Date Fri, 20 Sep 2019 01:31:36 GMT
nvander1 commented on a change in pull request #25666: [SPARK-28962][SQL] Provide index argument
to filter lambda functions
URL: https://github.com/apache/spark/pull/25666#discussion_r326442237
 
 

 ##########
 File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/higherOrderFunctions.scala
 ##########
 @@ -357,10 +359,23 @@ case class ArrayFilter(
 
   override def bind(f: (Expression, Seq[(DataType, Boolean)]) => LambdaFunction): ArrayFilter
= {
     val ArrayType(elementType, containsNull) = argument.dataType
-    copy(function = f(function, (elementType, containsNull) :: Nil))
+    function match {
+      case LambdaFunction(_, arguments, _) if arguments.size == 2 =>
+        copy(function = f(function, (elementType, containsNull) :: (IntegerType, false) ::
Nil))
+      case _ =>
+        copy(function = f(function, (elementType, containsNull) :: Nil))
 
 Review comment:
   ArrayTransform doesn't validate arguments.size > 2. I'm not sure what happens in that
case either.

----------------------------------------------------------------
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


Mime
View raw message