MaxGekk opened a new pull request #28643:
URL: https://github.com/apache/spark/pull/28643


   ### What changes were proposed in this pull request?
   Currently, the legacy fractional formatter is based on the implementation 
from Spark 2.4 which formats the input timestamp twice:
   ```
       val timestampString = ts.toString
       val formatted = legacyFormatter.format(ts)
   ```
   to strip trailing zeros. This PR proposes to avoid the second formatting via 
`SimpleDateFormat` by stripping `'.0'` directly.
   
   ### Why are the changes needed?
   It makes legacy fractional formatter faster.
   
   ### Does this PR introduce _any_ user-facing change?
   No
   
   ### How was this patch tested?
   By existing test "format fraction of second" in `TimestampFormatterSuite` + 
added test for timestamps before 1970-01-01 00:00:00Z


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