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/03/03 16:33:00 UTC

[jira] [Assigned] (SPARK-38407) ANSI Cast: loosen the limitation of casting non-null complex types

     [ https://issues.apache.org/jira/browse/SPARK-38407?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Apache Spark reassigned SPARK-38407:
------------------------------------

    Assignee: Apache Spark  (was: Gengliang Wang)

> ANSI Cast: loosen the limitation of casting non-null complex types
> ------------------------------------------------------------------
>
>                 Key: SPARK-38407
>                 URL: https://issues.apache.org/jira/browse/SPARK-38407
>             Project: Spark
>          Issue Type: Sub-task
>          Components: SQL
>    Affects Versions: 3.3.0, 3.2.2
>            Reporter: Gengliang Wang
>            Assignee: Apache Spark
>            Priority: Major
>
> When ANSI mode is off, `ArrayType(DoubleType, containsNull = false)` can't cast as `ArrayType(IntegerType, containsNull = false)` since there can be overflow thus result in null results and breaks the non-null constraint.
>  
> When ANSI mode is on, currently Spark SQL has the same behavior. However, this is not correct since the non-null constraint won't be break. Spark SQL can just execute the cast and throw runtime error on overflow, just like casting DoubleType as IntegerType.
>  
> This applies to MapType and StructType as well.
>  



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