GitHub user adrian-wang opened a pull request:
https://github.com/apache/spark/pull/2458
[SPARK-3598][SQL]cast to timestamp should be the same as hive
this patch fixes timestamp smaller than 0 and cast int as timestamp
select cast(1000 as timestamp) from src limit 1;
should return 1970-01-01 00:00:01, but we now take it as 1000 seconds.
also, current implementation has bug when the time is before 1970-01-01
00:00:00.
@rxin @marmbrus @chenghao-intel
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/adrian-wang/spark timestamp
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/2458.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #2458
----
commit 1234f666283172b28d5f17904fc3f2f5065a21ca
Author: Daoyuan Wang <[email protected]>
Date: 2014-09-19T10:11:49Z
fix timestamp smaller than 0 and cast int as timestamp
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]