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 2020/03/26 01:20:44 UTC

[GitHub] [spark] HyukjinKwon commented on a change in pull request #28024: [SPARK-31254][SQL] Use the current session time zone in `HiveResult.toHiveString`

HyukjinKwon commented on a change in pull request #28024: [SPARK-31254][SQL] Use the current session time zone in `HiveResult.toHiveString`
URL: https://github.com/apache/spark/pull/28024#discussion_r398264310
 
 

 ##########
 File path: sql/core/src/main/scala/org/apache/spark/sql/execution/HiveResult.scala
 ##########
 @@ -59,9 +59,9 @@ object HiveResult {
         .map(_.mkString("\t"))
   }
 
-  private lazy val zoneId = DateTimeUtils.getZoneId(SQLConf.get.sessionLocalTimeZone)
-  private lazy val dateFormatter = DateFormatter(zoneId)
-  private lazy val timestampFormatter = TimestampFormatter.getFractionFormatter(zoneId)
+  private def zoneId = DateTimeUtils.getZoneId(SQLConf.get.sessionLocalTimeZone)
+  private def dateFormatter = DateFormatter(zoneId)
+  private def timestampFormatter = TimestampFormatter.getFractionFormatter(zoneId)
 
 Review comment:
   @MaxGekk, which codes path access `SQLConf.get` here? Seems like we should clarify in the documentation that we should take other sessions into account since `TimestampFormatter` behaviours can be dependent on SQL configuration when this instance is created..

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