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 2021/12/23 05:55:00 UTC

[jira] [Updated] (SPARK-37714) ANSI mode: allow casting between numeric type and timestamp type

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

Gengliang Wang updated SPARK-37714:
-----------------------------------
    Summary: ANSI mode: allow casting between numeric type and timestamp type   (was: ANSI mode: allow casting between numeric type and timestamp type by default)

> ANSI mode: allow casting between numeric type and timestamp type 
> -----------------------------------------------------------------
>
>                 Key: SPARK-37714
>                 URL: https://issues.apache.org/jira/browse/SPARK-37714
>             Project: Spark
>          Issue Type: Sub-task
>          Components: SQL
>    Affects Versions: 3.3.0
>            Reporter: Gengliang Wang
>            Assignee: Gengliang Wang
>            Priority: Major
>
> h3. What changes were proposed?
>  * By default, allow casting between numeric type and timestamp type under ANSI mode
>  * Remove the user-facing configuration {{spark.sql.ansi.allowCastBetweenDatetimeAndNumeric}}
> h3. Why are the changes needed?
> Same reason as mentioned in [#34459|https://github.com/apache/spark/pull/34459]. It is for better adoption of ANSI SQL mode since users are relying on it:
>  * As we did some data science, we found that many Spark SQL users are actually using {{Cast(Timestamp as Numeric)}} and {{{}Cast(Numeric as Timestamp){}}}.
>  * The Spark SQL connector for Tableau is using this feature for DateTime math. e.g.
> {{CAST(FROM_UNIXTIME(CAST(CAST(%1 AS BIGINT) + (%2 * 86400) AS BIGINT)) AS TIMESTAMP)}}



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