[
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: [email protected]
For additional commands, e-mail: [email protected]