MaxGekk 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_r345990009
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeUtils.scala
##########
@@ -1164,4 +1166,30 @@ object DateTimeUtils {
threadLocalTimestampFormat.remove()
threadLocalDateFormat.remove()
}
+
+ class MicrosCalendar(tz: TimeZone) extends GregorianCalendar(tz, Locale.US) {
+ def getMicros(): SQLTimestamp = {
Review comment:
This check fails unfortunately:
```
check("yyyy-MM-dd'T'HH:mm:ss.SSSSSSXXX",
"2019-10-14T09:39:07.000010Z", "2019-10-14T09:39:07.000010Z")
```
```
Expected :1571045947000010
Actual :1571045947010000
```
because`.000010` is parsed to `10` inside of `SimpleDateFormat`.
I think this approach cannot work. :-(
----------------------------------------------------------------
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]