Github user davies commented on the pull request:
https://github.com/apache/spark/pull/6981#issuecomment-116814808
@tarekauel Thanks for working on this. After a quick look on it, I'm think
most of these implementation are slow, which turn the Long the into
java.sql.Date, generate a string, then parse the string back to Int.
At least, the last two parts should be avoided (generate a string then
parsing it). Also, I'm think of do the calculate based on seconds directly. The
difficult is that how to handle timezone and leap year, but they only affect in
some corner cases, we could have a fast path for most of the value, and
fallback to slow version for corner cases. For example, we can get the year by
`seconds / 3600 / 24 / 365.24` when the margin (days of a year) is large
enough.
---
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]