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 2020/05/05 06:22:38 UTC
[GitHub] [spark] MaxGekk commented on a change in pull request #28441: [SPARK-31630][SQL] Fix perf regression by skipping timestamps rebasing after some threshold
MaxGekk commented on a change in pull request #28441:
URL: https://github.com/apache/spark/pull/28441#discussion_r419886514
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/RebaseDateTime.scala
##########
@@ -286,6 +286,17 @@ object RebaseDateTime {
*/
private val gregJulianRebaseMap = loadRebaseRecords("gregorian-julian-rebase-micros.json")
+ private def getLastSwitchTs(rebaseMap: AnyRefMap[String, RebaseInfo]): Long = {
+ val latestTs = rebaseMap.values.map(_.switches.last).max
+ require(rebaseMap.values.forall(_.diffs.last == 0),
Review comment:
It uses `latestTs` in the error message. I am going to improve the message by converting micros to Instant, so, toString should form nicer string:
```scala
require(rebaseMap.values.forall(_.diffs.last == 0),
s"Differences between Julian and Gregorian calendar after ${microsToInstant(latestTs)} " +
"are expected to be zero for available time zones.")
```
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org