GitHub user ckadner opened a pull request:
https://github.com/apache/spark/pull/6242
SPARK-6785: fix DateUtils.fromJavaDate(java.util.Date) for Dates before 1970
BUG: With the current implementation, the from-to-Java date conversion will
be off by one day for Dates before 1970 because of a rounding (truncate) flaw
in the function DateUtils#millisToDays(Long).
FIX: The fix is to do the conversion using Double and flooring the
fractions instead of truncating them.
NOTE: Before this fix, the code DID work for Dates that are NOT one
millisecond before or after midnight in the system's local time zone.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/ckadner/spark master
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/6242.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 #6242
----
commit 6bb4ff4cbfc00b630504e23442f3137500743e8e
Author: Christian Kadner <[email protected]>
Date: 2015-05-18T20:08:19Z
SPARK-6785: use Math.floor() when converting milliseconds to days in
function millisToDays(Long) otherwise the result of calling function
fromJavaDate(java.util.Date) will be off by one day for Dates before 1970
----
---
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]