[
https://issues.apache.org/jira/browse/SPARK-30793?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Wenchen Fan reassigned SPARK-30793:
-----------------------------------
Assignee: Maxim Gekk
> Wrong truncations of timestamps before the epoch to minutes and seconds
> -----------------------------------------------------------------------
>
> Key: SPARK-30793
> URL: https://issues.apache.org/jira/browse/SPARK-30793
> Project: Spark
> Issue Type: Bug
> Components: SQL
> Affects Versions: 3.0.0
> Reporter: Maxim Gekk
> Assignee: Maxim Gekk
> Priority: Major
>
> Truncations to seconds and minutes of timestamps after the epoch are correct:
> {code:sql}
> spark-sql> select date_trunc('SECOND', '2020-02-11 00:01:02.123'),
> date_trunc('SECOND', '2020-02-11 00:01:02.789');
> 2020-02-11 00:01:02 2020-02-11 00:01:02
> {code}
> but truncations of timestamps before the epoch are incorrect:
> {code:sql}
> spark-sql> select date_trunc('SECOND', '1960-02-11 00:01:02.123'),
> date_trunc('SECOND', '1960-02-11 00:01:02.789');
> 1960-02-11 00:01:03 1960-02-11 00:01:03
> {code}
> The result must be *1960-02-11 00:01:02 1960-02-11 00:01:02*
> The same for the MINUTE level:
> {code:sql}
> spark-sql> select date_trunc('MINUTE', '1960-02-11 00:01:01'),
> date_trunc('MINUTE', '1960-02-11 00:01:50');
> 1960-02-11 00:02:00 1960-02-11 00:02:00
> {code}
> The result must be 1960-02-11 00:01:00 1960-02-11 00:01:00
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]