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 2021/10/29 12:14:00 UTC

[jira] [Commented] (SPARK-37163) Disallow casting Date as Numeric types

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

Apache Spark commented on SPARK-37163:
--------------------------------------

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

> Disallow casting Date as Numeric types
> --------------------------------------
>
>                 Key: SPARK-37163
>                 URL: https://issues.apache.org/jira/browse/SPARK-37163
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 3.3.0
>            Reporter: Gengliang Wang
>            Assignee: Gengliang Wang
>            Priority: Major
>
> Currently, Date type values can be cast as Numeric types. However, the result is always NULL.
> On the other hand, Numeric values can't be cast as Date type.
> It doesn't make sense to keep the behavior of casting Date to null numeric types. I suggest to disallow the conversion. We can have a legacy flag `spark.sql.legacy.allowCastDateAsNumeric` if users really want to fall back to the legacy behavior.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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