[ 
https://issues.apache.org/jira/browse/SPARK-18736?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15851078#comment-15851078
 ] 

Eyal Farago commented on SPARK-18736:
-------------------------------------

Spark-8601 is making (slow) progress,it's actually in final stages of review 
now.
One thing to notice is keeping direct evaluation,code generation and optimized 
version in sync, spark-8601 follows the current behavior of "first wins" by 
transforming map(...).Get(k) into a caseKeyWhen(k,...).
If we decide to choose a "last wins" approach,the optimized version would 
probably have to reverse the order of the keys.

> CreateMap allows non-unique keys
> --------------------------------
>
>                 Key: SPARK-18736
>                 URL: https://issues.apache.org/jira/browse/SPARK-18736
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 2.0.0
>            Reporter: Eyal Farago
>              Labels: map, sql, types
>
> Spark-Sql, {{CreateMap}} does not enforce unique keys, i.e. it's possible to 
> create a map with two identical keys: 
> {noformat}
> CreateMap(Literal(1), Literal(11), Literal(1), Literal(12))
> {noformat}
> This does not behave like standard maps in common programming languages.
> proper behavior should be chosen:
> # first 'wins'
> # last 'wins'
> # runtime error.
> {{GetMapValue}} currently implements option #1. Even if this is the desired 
> behavior {{CreateMap}} should return a unique map.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to