spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rxin <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-13513] [SQL] verify Feb 29 works on a l...
Date Sun, 28 Feb 2016 08:20:03 GMT
Github user rxin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/11394#discussion_r54345820
  
    --- Diff: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/DateTimeUtilsSuite.scala
---
    @@ -485,4 +487,70 @@ class DateTimeUtilsSuite extends SparkFunSuite {
         test("2011-12-25 01:00:00.123456", "PST", "2011-12-25 09:00:00.123456")
         test("2011-12-25 17:00:00.123456", "Asia/Shanghai", "2011-12-25 09:00:00.123456")
       }
    +
    +  val feb29T = "2016-02-29T00:00:00Z"
    +  val feb29_midnight = "2016-02-29 00:00:00"
    +  val feb29Date = new Date(2016 - 1900, 1, 29)
    +
    +  test("SQLDate leap years") {
    +    val c = Calendar.getInstance()
    +    c.set(2016, 1, 29, 0, 0, 0)
    +    c.set(Calendar.MILLISECOND, 0)
    +    def sqlDate(d: String): SQLDate = {
    +      stringToDate(UTF8String.fromString(d)).get
    +    }
    +    val feb29 = sqlDate("2016-02-29")
    +    assert(feb29 === millisToDays(c.getTimeInMillis))
    +    val mar31 = sqlDate("2016-03-31")
    +    val feb28 = sqlDate("2016-02-28")
    +    val april1 = sqlDate("2016-04-01")
    +    val april30 = sqlDate("2016-04-30")
    +
    +    def assertDate(r: (Int, Int, Int, Int), q: Int, d1: SQLDate): Unit = {
    --- End diff --
    
    this parameter list is fairly confusing ...



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