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/08/12 15:05:00 UTC
[jira] [Commented] (SPARK-36497) Support Interval add/subtract NULL
[ https://issues.apache.org/jira/browse/SPARK-36497?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17398117#comment-17398117 ]
Apache Spark commented on SPARK-36497:
--------------------------------------
User 'gengliangwang' has created a pull request for this issue:
https://github.com/apache/spark/pull/33727
> Support Interval add/subtract NULL
> ----------------------------------
>
> Key: SPARK-36497
> URL: https://issues.apache.org/jira/browse/SPARK-36497
> Project: Spark
> Issue Type: Sub-task
> Components: SQL
> Affects Versions: 3.2.0
> Reporter: Gengliang Wang
> Assignee: Gengliang Wang
> Priority: Major
>
> Currently, `null + interval` will become `cast(cast(null as timestamp) + interval) as null`. This is a unexpected behavior and the result should not be of null type.
> This weird behavior applies to `null - interval`, `interval + null`, `interval - null` as well.
> To change it, I propose to cast the null as the same data type of the other element in the add/subtract:
> ```
> null + interval => cast(null as interval) + interval
> null - interval => cast(null as interval) - interval
> interval + null=> interval + cast(null as interval)
> interval - null => interval - cast(null as interval)
> ```
--
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