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

Apache Spark commented on SPARK-40066:
--------------------------------------

User 'gengliangwang' has created a pull request for this issue:
https://github.com/apache/spark/pull/37503

> ANSI mode: always return null on invalid access to map column
> -------------------------------------------------------------
>
>                 Key: SPARK-40066
>                 URL: https://issues.apache.org/jira/browse/SPARK-40066
>             Project: Spark
>          Issue Type: Sub-task
>          Components: SQL
>    Affects Versions: 3.4.0
>            Reporter: Gengliang Wang
>            Assignee: Gengliang Wang
>            Priority: Major
>
> Since https://github.com/apache/spark/pull/30386, Spark always throws an 
> error on invalid access to a map column. There is no such syntax in the ANSI 
> SQL standard since there is no Map type in it. There is a similar type 
> `multiset` which returns null on non-existing element access.
> Also, I investigated PostgreSQL/Snowflake/Biguqery and all of them returns 
> null return on map(json) key not exists.
> I suggest loosen the the syntax here. When users get the error, most of them 
> will just use `try_element_at()` to get the same syntax or just turn off the 
> ANSI SQL mode.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to