GitHub user ueshin opened a pull request:
https://github.com/apache/spark/pull/21965
[WIP][SPARK-23909][SQL] Add filter function.
## What changes were proposed in this pull request?
This pr adds `filter` function which filters the input array using the
given predicate.
```sql
> SELECT filter(array(1, 2, 3), x -> x % 2 == 1);
array(1, 3)
```
## How was this patch tested?
Added tests.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/ueshin/apache-spark issues/SPARK-23909/filter
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/21965.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #21965
----
commit c3bf6a0059a151ba23cf32c842e31ced3b28726c
Author: Takuya UESHIN <ueshin@...>
Date: 2018-08-01T03:46:00Z
Add `ArrayTransform`.
commit fe48510dc3c5d67e849d504212cd17657faa3966
Author: Takuya UESHIN <ueshin@...>
Date: 2018-08-02T06:11:52Z
Add `ArrayFilter`.
----
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]