You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/03/08 21:56:23 UTC

[GitHub] [spark] MaxGekk opened a new pull request #24030: [SPARK-27109][SQL] Refactoring of TimestampFormatter and DateFormatter

MaxGekk opened a new pull request #24030: [SPARK-27109][SQL] Refactoring of TimestampFormatter and DateFormatter
URL: https://github.com/apache/spark/pull/24030
 
 
   ## What changes were proposed in this pull request?
   
   In PR, I propose to refactor the `parse()` method of `Iso8601DateFormatter`/`Iso8601DateFormatter` and `toInstantWithZoneId` of `toInstantWithZoneId` to achieve the following:
   - Avoid unnecessary conversion of parsed input to `java.time.Instant` before converting it to micros and days. Necessary information exists in `ZonedDateTime` already, and micros/days can be extracted from the former one.
   - Avoid additional extraction of LocalTime from parsed object, more precisely, double query of `TemporalQueries.localTime` from `temporalAccessor`.
   - Avoid additional extraction of zone id from parsed object, in particular, double query of `TemporalQueries.offset()`.
   
   ## How was this patch tested?
   
   By existing test suite `DateTimeUtilsSuite`, `TimestampFormatterSuite` and `DateFormatterSuite`.
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org