You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Apache Spark (Jira)" <ji...@apache.org> on 2022/02/10 12:54:00 UTC

[jira] [Commented] (SPARK-38176) ANSI mode: allow implicitly casting String to other simple types

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

Apache Spark commented on SPARK-38176:
--------------------------------------

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

> ANSI mode: allow implicitly casting String to other simple types
> ----------------------------------------------------------------
>
>                 Key: SPARK-38176
>                 URL: https://issues.apache.org/jira/browse/SPARK-38176
>             Project: Spark
>          Issue Type: Sub-task
>          Components: SQL
>    Affects Versions: 3.3.0
>            Reporter: Gengliang Wang
>            Assignee: Gengliang Wang
>            Priority: Major
>
> Compared to the default behavior, the current ANSI type coercion rules don't allow the following cases:
>  * comparing String with other simple types, e.g. date/timestamp/int ...
>  * arithmetic op with String and other simple types
>  * Union/Intersect/Except with String and other simple types
>  * SQL function expects non-string types but got  string input
>  * other SQL operators..
> The original purpose is to prevent potential String parsing errors under ANSI mode. However, after doing research among real-world Spark SQL queries, I find that many users are actually using String as Date/Timestamp/Numeric in their queries. 
>  
> To make the migration to ANSI mode easier, I suggest removing this limitation. 



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

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