Github user davies commented on the pull request:
https://github.com/apache/spark/pull/8400#issuecomment-134482339
@yhuai The Julian day of epoch of unix timestamp (1970-01-01 0:0:0) is
2440587.5, if we use integer for julian days, then it will be cut off at noon
(12pm) of a day. But the nanoseconds is counted from 12am, so they are
overlapped from 12am to 12pm. In Hive, it create a calendar from Julian day
(which will have hours as 12pm), it then re-set the hours from nanoseconds.
In this patch, we use a trick to shift Julian days by 0.5 day then rounding
0.5 down to zero (In Hive, it rounds 0.5 up to 1), then we can add these two
parts together.
---
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]