You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by holdenk <gi...@git.apache.org> on 2016/07/30 01:35:23 UTC

[GitHub] spark pull request #14398: [SPARK-16774][SQL][WIP] Fix use of deprecated tim...

Github user holdenk commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14398#discussion_r72879633
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeUtils.scala ---
    @@ -875,11 +877,11 @@ object DateTimeUtils {
             val hh = seconds / 3600
             val mm = seconds / 60 % 60
             val ss = seconds % 60
    -        val nano = millisOfDay % 1000 * 1000000
    +        val calendar = Calendar.getInstance(tz)
     
    -        // create a Timestamp to get the unix timestamp (in UTC)
    -        val timestamp = new Timestamp(year - 1900, month - 1, day, hh, mm, ss, nano)
    -        guess = (millisLocal - timestamp.getTime).toInt
    +        calendar.set(year, month, day, hh, mm, ss)
    --- End diff --
    
    So DST is probably ok and my tests are just borked - so lets go with the new calendar approach and I'll fix it to preserve ms information.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org