MaxGekk commented on a change in pull request #28582: URL: https://github.com/apache/spark/pull/28582#discussion_r427991001
########## 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: > should omit tailing 0 already. The reason of making this PR is to pass java.sql.Timestamp to a legacy formatter which can accept the type but the legacy formatter of fractionFormatter is SimpleDateFormat **which cannot omit tailing 0.** > is it really needed? I think so. What do you propose instead of it? ---------------------------------------------------------------- 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 --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org