You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/01/25 07:33:34 UTC

[GitHub] MaxGekk commented on a change in pull request #23641: [SPARK-26719][SQL] Get rid of java.util.Calendar in DateTimeUtils

MaxGekk commented on a change in pull request #23641: [SPARK-26719][SQL] Get rid of java.util.Calendar in DateTimeUtils
URL: https://github.com/apache/spark/pull/23641#discussion_r250888103
 
 

 ##########
 File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/DateTimeTestUtils.scala
 ##########
 @@ -17,12 +17,16 @@
 
 package org.apache.spark.sql.catalyst.util
 
+import java.time.{LocalDate, LocalDateTime, LocalTime}
 import java.util.TimeZone
+import java.util.concurrent.TimeUnit
+
+import org.apache.spark.sql.catalyst.util.DateTimeUtils.TimeZoneUTC
 
 /**
  * Helper functions for testing date and time functionality.
  */
-object DateTimeTestUtils {
+trait DateTimeTestUtils {
 
 Review comment:
   > If there is no clear benefit, I prefer to keep the previous object DateTimeTestUtils ...
   
   This is mostly for consistency. As I can see we usually mix common code from traits: `ExpressionEvalHelper`, `TestJsonData` and etc. 
   
   > Also, @MaxGekk . This PR is mostly a refactoring instead of simple Get rid of java.util.Calendar. It would be better if we use a matched PR title next time.
   
   The PR changes implementation of 2 methods `truncTimestamp` and `getOffsetFromLocalMillis`, and changes their behavior for dates before 1582 (I will update migration guide). I cannot fully agree it is refactoring. And PR's title reflect actual goal - remove last 2 places (except tests) where the hybrid calendar is used explicitly.

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


With regards,
Apache Git Services

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