You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Xiao Li (JIRA)" <ji...@apache.org> on 2018/04/09 07:04:00 UTC
[jira] [Created] (SPARK-23937) High-order function: map_filter(map, function) → MAP
Xiao Li created SPARK-23937:
-------------------------------
Summary: High-order function: map_filter(map<K, V>, function<K, V, boolean>) → MAP<K,V>
Key: SPARK-23937
URL: https://issues.apache.org/jira/browse/SPARK-23937
Project: Spark
Issue Type: Sub-task
Components: SQL
Affects Versions: 2.3.0
Reporter: Xiao Li
Constructs a map from those entries of map for which function returns true:
{noformat}
SELECT map_filter(MAP(ARRAY[], ARRAY[]), (k, v) -> true); -- {}
SELECT map_filter(MAP(ARRAY[10, 20, 30], ARRAY['a', NULL, 'c']), (k, v) -> v IS NOT NULL); -- {10 -> a, 30 -> c}
SELECT map_filter(MAP(ARRAY['k1', 'k2', 'k3'], ARRAY[20, 3, 15]), (k, v) -> v > 10); -- {k1 -> 20, k3 -> 15}
{noformat}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org