You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Hyukjin Kwon (JIRA)" <ji...@apache.org> on 2017/06/17 09:32:00 UTC
[jira] [Resolved] (SPARK-21116) Support map_contains function
[ https://issues.apache.org/jira/browse/SPARK-21116?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Hyukjin Kwon resolved SPARK-21116.
----------------------------------
Resolution: Won't Fix
I would do this with array_contains(map_keys(...), ...)
{code}
scala> sql("select array_contains(map_keys(map(1, 'a', 2, 'b')) , 1)").show()
+--------------------------------------------+
|array_contains(map_keys(map(1, a, 2, b)), 1)|
+--------------------------------------------+
| true|
+--------------------------------------------+
{code}
I am resolving this as the workaround looks so easy and the opinion above.
> Support map_contains function
> -----------------------------
>
> Key: SPARK-21116
> URL: https://issues.apache.org/jira/browse/SPARK-21116
> Project: Spark
> Issue Type: New Feature
> Components: SQL
> Affects Versions: 2.0.2, 2.1.1
> Reporter: darion yaphet
>
> map_contains(map , key)
> Check whether the map contains the key . Returns true if the map contains the key. It's similar with *array_contains*
> for example : map_contains(map(1, 'a', 2, 'b') , 1) will return true .
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org