clownxc commented on code in PR #8659:
URL: https://github.com/apache/hudi/pull/8659#discussion_r1189257444


##########
hudi-common/src/main/java/org/apache/hudi/common/table/timeline/HoodieInstantTimeGenerator.java:
##########
@@ -94,7 +96,9 @@ public static Date parseDateFromInstantTime(String timestamp) 
throws ParseExcept
       }
 
       LocalDateTime dt = LocalDateTime.parse(timestampInMillis, 
MILLIS_INSTANT_TIME_FORMATTER);
-      return Date.from(dt.atZone(ZoneId.systemDefault()).toInstant());
+      Instant instant = dt.atZone(getZoneId()).toInstant();
+      TimeZone.setDefault(TimeZone.getTimeZone(getZoneId()));
+      return Date.from(instant);

Review Comment:
   > It is risky to set up timezone per JVM process: `TimeZone.setDefault(`, 
this could impact all the threads in the JVM.
   
   One of the tests failed, I will try to find the reason and change the code.
   ```
   [ERROR] Failures: 
   [ERROR]   
TestHoodieDeltaStreamer.testCleanerDeleteReplacedDataWithArchive:1120 expected: 
<1> but was: <0>
   [ERROR]   
TestHoodieDeltaStreamer.testCleanerDeleteReplacedDataWithArchive:1090 expected: 
<false> but was: <true>
   [ERROR]   
TestHoodieDeltaStreamer.testCleanerDeleteReplacedDataWithArchive:1120 expected: 
<1> but was: <0>
   [ERROR]   
TestHoodieDeltaStreamer.testCleanerDeleteReplacedDataWithArchive:1090 expected: 
<false> but was: <true>
   [INFO] 
   [ERROR] Tests run: 354, Failures: 4, Errors: 0, Skipped: 7
   ```



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

To unsubscribe, e-mail: commits-unsubscr...@hudi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to