spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From srowen <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-9541][SQL]DataTimeUtils cleanup
Date Mon, 03 Aug 2015 08:53:18 GMT
Github user srowen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/7870#discussion_r36066421
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeUtils.scala
---
    @@ -494,44 +494,54 @@ object DateTimeUtils {
       }
     
       /**
    -   * Returns the month value for the given date. The date is expressed in days
    -   * since 1.1.1970. January is month 1.
    +   * Split date (expressed in days since 1.1.1970) into four fields:
    +   * year, month (Jan is Month 1), dayInMonth, daysToMonthEnd (0 if it's last day of
month).
        */
    -  def getMonth(date: Int): Int = {
    +  def splitDate(date: Int): (Int, Int, Int, Int) = {
    --- End diff --
    
    PS I'm also referring to the `java.util.time` package, aka the old Joda Time that's now
part of the JDK. This is the better API to use and thus to benchmark. It's not just about
speed, but correctness; there are plenty of bizarre corner cases to handle with dates of course


---
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


Mime
View raw message