MaxGekk opened a new pull request #23936: [SPARK-27031][SQL] Avoid double 
formatting in timestampToString
URL: https://github.com/apache/spark/pull/23936
 
 
   ## What changes were proposed in this pull request?
   
   Removed unnecessary conversion of microseconds in 
`DateTimeUtils.timestampToString` to `java.sql.Timestamp` which aims to output 
fraction of seconds by casting it to string. This was replaced by regular 
`TimestampFormatter` based on special pattern. The pattern is handled 
separately, and append fraction formatter to `DateTimeFormatterBuilder` in 
`DateTimeFormatterHelper`: `appendFraction(ChronoField.NANO_OF_SECOND, 0, 9, 
true)`. The former one means trailing zeros in second's fraction should be 
truncated while formatting. 
   
   ## How was this patch tested?
   
   By existing test suites like `CastSuite`, `DateTimeUtilsSuite`, `JDBCSuite`, 
and by new test in `TimestampFormatterSuite`.

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


With regards,
Apache Git Services

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

Reply via email to