cloud-fan commented on a change in pull request #28582:
URL: https://github.com/apache/spark/pull/28582#discussion_r428013612



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/TimestampFormatter.scala
##########
@@ -100,10 +111,26 @@ class Iso8601TimestampFormatter(
  */
 class FractionTimestampFormatter(zoneId: ZoneId)
   extends Iso8601TimestampFormatter(
-    "", zoneId, TimestampFormatter.defaultLocale, needVarLengthSecondFraction 
= false) {
+    TimestampFormatter.defaultPattern,
+    zoneId,
+    TimestampFormatter.defaultLocale,
+    needVarLengthSecondFraction = false) {
 
   @transient
   override protected lazy val formatter = 
DateTimeFormatterHelper.fractionFormatter
+
+  // Converts Timestamp to string according to Hive TimestampWritable 
convention.
+  // The code is borrowed from Spark 2.4 DateTimeUtils.timestampToString

Review comment:
       Let's make the comment more clear:
   ```
   // The new formatter will omit the trailing 0 in the timestamp string, but 
the legacy formatter can't.
   // Here we borrow the code from Spark 2.4 DateTimeUtils.timestampToString to 
omit the
   // trailing 0 for the legacy formatter as well.
   ```
   We don't need to mention hive at all. This is just for internal consistency.




----------------------------------------------------------------
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to