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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to