You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Wenchen Fan (Jira)" <ji...@apache.org> on 2021/08/13 03:12:00 UTC
[jira] [Resolved] (SPARK-36497) Support Interval add/subtract NULL
[ https://issues.apache.org/jira/browse/SPARK-36497?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Wenchen Fan resolved SPARK-36497.
---------------------------------
Fix Version/s: 3.2.0
Resolution: Fixed
Issue resolved by pull request 33727
[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
> Fix For: 3.2.0
>
>
> 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