cloud-fan commented on a change in pull request #26507: [WIP][SQL][2.4] Parse 
timestamps in microsecond precision in JSON datasource
URL: https://github.com/apache/spark/pull/26507#discussion_r346221267
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeUtils.scala
 ##########
 @@ -1164,4 +1167,23 @@ object DateTimeUtils {
     threadLocalTimestampFormat.remove()
     threadLocalDateFormat.remove()
   }
+
+  class MicrosCalendar(tz: TimeZone) extends GregorianCalendar(tz, Locale.US) {
+    def getMicros(digitsInFraction: Int): SQLTimestamp = {
 
 Review comment:
   from the doc:
   ```
   Fraction: Outputs the nano-of-second field as a fraction-of-second. The 
nano-of-second value has nine digits, thus the count of pattern letters is from 
1 to 9. If it is less than 9, then the nano-of-second value is truncated, with 
only the most significant digits being output.
   ```
   
   So we need to truncate.
   
   Can we add some comments to explain what we are doing here? It's really 
tricky.

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