[GitHub] [spark] MaxGekk commented on a change in pull request #27596: [WIP] Fix getting of time components before 1582 year

2020-02-15 Thread GitBox
MaxGekk commented on a change in pull request #27596: [WIP] Fix getting of time 
components before 1582 year
URL: https://github.com/apache/spark/pull/27596#discussion_r379881626
 
 

 ##
 File path: 
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/DateTimeUtilsSuite.scala
 ##
 @@ -290,32 +293,38 @@ class DateTimeUtilsSuite extends SparkFunSuite with 
Matchers with SQLHelper {
   }
 
   test("hours") {
-var input = date(2015, 3, 18, 13, 2, 11, 0, TimeZonePST)
-assert(getHours(input, TimeZonePST) === 13)
-assert(getHours(input, TimeZoneGMT) === 20)
-input = date(2015, 12, 8, 2, 7, 9, 0, TimeZonePST)
-assert(getHours(input, TimeZonePST) === 2)
-assert(getHours(input, TimeZoneGMT) === 10)
+var input = date(2015, 3, 18, 13, 2, 11, 0, zonePST)
+assert(getHours(input, zonePST) === 13)
+assert(getHours(input, zoneGMT) === 20)
+input = date(2015, 12, 8, 2, 7, 9, 0, zonePST)
+assert(getHours(input, zonePST) === 2)
+assert(getHours(input, zoneGMT) === 10)
+input = date(10, 1, 1, 0, 0, 0, 0, zonePST)
+assert(getHours(input, zonePST) === 0)
 
 Review comment:
   Before the changes:
   ```sql
   spark-sql> select hour(timestamp '0010-01-01 00:00:00');
   23
   ```


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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



[GitHub] [spark] MaxGekk commented on a change in pull request #27596: [WIP] Fix getting of time components before 1582 year

2020-02-15 Thread GitBox
MaxGekk commented on a change in pull request #27596: [WIP] Fix getting of time 
components before 1582 year
URL: https://github.com/apache/spark/pull/27596#discussion_r379881509
 
 

 ##
 File path: 
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/DateTimeUtilsSuite.scala
 ##
 @@ -290,32 +293,38 @@ class DateTimeUtilsSuite extends SparkFunSuite with 
Matchers with SQLHelper {
   }
 
   test("hours") {
-var input = date(2015, 3, 18, 13, 2, 11, 0, TimeZonePST)
-assert(getHours(input, TimeZonePST) === 13)
-assert(getHours(input, TimeZoneGMT) === 20)
-input = date(2015, 12, 8, 2, 7, 9, 0, TimeZonePST)
-assert(getHours(input, TimeZonePST) === 2)
-assert(getHours(input, TimeZoneGMT) === 10)
+var input = date(2015, 3, 18, 13, 2, 11, 0, zonePST)
+assert(getHours(input, zonePST) === 13)
+assert(getHours(input, zoneGMT) === 20)
+input = date(2015, 12, 8, 2, 7, 9, 0, zonePST)
+assert(getHours(input, zonePST) === 2)
+assert(getHours(input, zoneGMT) === 10)
+input = date(10, 1, 1, 0, 0, 0, 0, zonePST)
+assert(getHours(input, zonePST) === 0)
 
 Review comment:
   This is new test.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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



[GitHub] [spark] MaxGekk commented on a change in pull request #27596: [WIP] Fix getting of time components before 1582 year

2020-02-15 Thread GitBox
MaxGekk commented on a change in pull request #27596: [WIP] Fix getting of time 
components before 1582 year
URL: https://github.com/apache/spark/pull/27596#discussion_r379880203
 
 

 ##
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala
 ##
 @@ -51,7 +51,6 @@ trait TimeZoneAwareExpression extends Expression {
   /** Returns a copy of this expression with the specified timeZoneId. */
   def withTimeZone(timeZoneId: String): TimeZoneAwareExpression
 
-  @transient lazy val timeZone: TimeZone = 
DateTimeUtils.getTimeZone(timeZoneId.get)
 
 Review comment:
   Finally, all expressions bound on legacy `TimeZone` have been gone.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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