[SPARK-28962][SQL][FOLLOW-UP] Add the parameter description for the Scala function API filter
### What changes were proposed in this pull request? This PR is a follow-up PR https://github.com/apache/spark/pull/25666 for adding the description and example for the Scala function API `filter`. ### Why are the changes needed? It is hard to tell which parameter is the index column. ### Does this PR introduce any user-facing change? No ### How was this patch tested? N/A Closes #27336 from gatorsmile/spark28962. Authored-by: Xiao Li <gatorsmile@gmail.com> Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
This commit is contained in:
parent
3f76bd4002
commit
ddf83159a8
|
@ -3455,6 +3455,13 @@ object functions {
|
|||
|
||||
/**
|
||||
* Returns an array of elements for which a predicate holds in a given array.
|
||||
* {{{
|
||||
* df.select(filter(col("s"), x => x % 2 === 0))
|
||||
* df.selectExpr("filter(col, x -> x % 2 == 0)")
|
||||
* }}}
|
||||
*
|
||||
* @param column: the input array column
|
||||
* @param f: col => predicate, the boolean predicate to filter the input column
|
||||
*
|
||||
* @group collection_funcs
|
||||
* @since 3.0.0
|
||||
|
@ -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.
|
||||
*
|
||||
* @group collection_funcs
|
||||
* @since 3.0.0
|
||||
|
|
Loading…
Reference in a new issue