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/04 06:33:59 UTC

[GitHub] [spark] cloud-fan commented on a change in pull request #27336: [SPARK-28962][SQL][FOLLOW-UP] Add the parameter description for the Scala function API filter

cloud-fan commented on a change in pull request #27336: [SPARK-28962][SQL][FOLLOW-UP] Add the parameter description for the Scala function API filter
URL: https://github.com/apache/spark/pull/27336#discussion_r374494773
 
 

 ##########
 File path: sql/core/src/main/scala/org/apache/spark/sql/functions.scala
 ##########
 @@ -3465,6 +3472,14 @@ object functions {
 
   /**
    * Returns an array of elements for which a predicate holds in a given array.
+   * {{{
+   *   df.select(filter(col("s"), (x, i) => i % 2 === 0))
+   *   df.selectExpr("filter(col, (x, i) -> i % 2 == 0)")
+   * }}}
+   *
+   * @param column: the input array column
+   * @param f: (col, index) => predicate, the boolean predicate to filter the input column
+   *           given the index. Indices start at 0.
 
 Review comment:
   is this consistent within Spark that the indices parameter starts with 0 in higher-order functions? @ueshin @HyukjinKwon 

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