Re: [PR] [SPARK-48042][SQL] Don't use a copy of timestamp formatter with a new override zone for each value [spark]

2024-04-29 Thread via GitHub


dongjoon-hyun commented on code in PR #46282:
URL: https://github.com/apache/spark/pull/46282#discussion_r1583390145


##
sql/api/src/main/scala/org/apache/spark/sql/catalyst/util/TimestampFormatter.scala:
##
@@ -231,7 +233,7 @@ class Iso8601TimestampFormatter(
 
   override def format(instant: Instant): String = {
 try {
-  formatter.withZone(zoneId).format(instant)
+  zonedFormatter.format(instant)

Review Comment:
   So, this is a performance improvement? 
   - If this is perf improvement, we don't need a test case.
   - However, the title could be misleading because it sounds like a bug. :) 
Could you revise it like improvement?



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

To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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



Re: [PR] [SPARK-48042][SQL] Don't use a copy of timestamp formatter with a new override zone for each value [spark]

2024-04-29 Thread via GitHub


dongjoon-hyun commented on code in PR #46282:
URL: https://github.com/apache/spark/pull/46282#discussion_r1583388167


##
sql/api/src/main/scala/org/apache/spark/sql/catalyst/util/TimestampFormatter.scala:
##
@@ -159,8 +159,10 @@ class Iso8601TimestampFormatter(
 isParsing: Boolean)
   extends TimestampFormatter with DateTimeFormatterHelper {
   @transient
-  protected lazy val formatter: DateTimeFormatter =
-getOrCreateFormatter(pattern, locale, isParsing)
+  protected lazy val formatter: DateTimeFormatter = 
getOrCreateFormatter(pattern, locale, isParsing)

Review Comment:
   Shall we revert this style change?



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

To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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