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

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

Gengliang Wang created SPARK-38176:
--------------------------------------

             Summary: 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


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