You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Maxim Gekk (Jira)" <ji...@apache.org> on 2020/02/17 17:19:01 UTC
[jira] [Updated] (SPARK-30793) Wrong truncations of timestamps
before the epoch to minutes and seconds
[ https://issues.apache.org/jira/browse/SPARK-30793?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Maxim Gekk updated SPARK-30793:
-------------------------------
Affects Version/s: 2.4.5
> 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: 2.4.5, 3.0.0
> Reporter: Maxim Gekk
> Assignee: Maxim Gekk
> Priority: Major
> Fix For: 3.0.0
>
>
> 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: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org