1
0

[HUDI-1794] Moved static COMMIT_FORMATTER to thread local variable as SimpleDateFormat is not thread safe. (#2819)

This commit is contained in:
Prashant Wason
2021-11-05 06:31:42 -07:00
committed by GitHub
parent 3af6568d31
commit b7ee341e14
19 changed files with 196 additions and 53 deletions

View File

@@ -218,13 +218,13 @@ class TestTimeTravelQuery extends HoodieClientTestBase {
}
private def defaultDateTimeFormat(queryInstant: String): String = {
val date = HoodieActiveTimeline.COMMIT_FORMATTER.parse(queryInstant)
val date = HoodieActiveTimeline.parseInstantTime(queryInstant)
val format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
format.format(date)
}
private def defaultDateFormat(queryInstant: String): String = {
val date = HoodieActiveTimeline.COMMIT_FORMATTER.parse(queryInstant)
val date = HoodieActiveTimeline.parseInstantTime(queryInstant)
val format = new SimpleDateFormat("yyyy-MM-dd")
format.format(date)
}