Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/7473#discussion_r34943083
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeUtils.scala
 ---
    @@ -320,16 +320,17 @@ object DateTimeUtils {
           Calendar.getInstance(
             
TimeZone.getTimeZone(f"GMT${timeZone.get.toChar}${segments(7)}%02d:${segments(8)}%02d"))
         }
    +    c.set(Calendar.MILLISECOND, 0)
     
         if (justTime) {
    -      c.set(Calendar.HOUR, segments(3))
    +      c.set(Calendar.HOUR_OF_DAY, segments(3))
           c.set(Calendar.MINUTE, segments(4))
           c.set(Calendar.SECOND, segments(5))
         } else {
           c.set(segments(0), segments(1) - 1, segments(2), segments(3), 
segments(4), segments(5))
         }
     
    -    Some(c.getTimeInMillis / 1000 * 1000000 + segments(6))
    +    Some(c.getTimeInMillis * 1000 + segments(6))
    --- End diff --
    
    Let's say now is a second before 1970-1-1:
    ```scala
    val c = Calendar.getInstance(TimeZone.getTimeZone("GMT"))
    c.set(1969, 11, 31, 23, 59, 59)
    c.getTimeInMillis // something bigger than -1000, maybe -700
    c.getTimeInMillis / 1000 * 1000000 == 0
    c.set(Calendar.MILLISECOND, 0)
    c.getTimeInMillis // exactly -1000
    c.getTimeInMillis * 1000 == -1000000
    ```
    However,  I have not figured out why jenkins passes the test before...


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

Reply via email to