TengHuo commented on code in PR #6000:
URL: https://github.com/apache/hudi/pull/6000#discussion_r948715773


##########
hudi-common/src/main/java/org/apache/hudi/common/table/timeline/HoodieInstantTimeGenerator.java:
##########
@@ -97,7 +103,7 @@ public static Date parseDateFromInstantTime(String 
timestamp) throws ParseExcept
       return Date.from(dt.atZone(ZoneId.systemDefault()).toInstant());
     } catch (DateTimeParseException e) {
       // Special handling for all zero timestamp which is not parsable by 
DateTimeFormatter
-      if (timestamp.equals(ALL_ZERO_TIMESTAMP)) {
+      if (NOT_PARSABLE_TIMESTAMPS.contains(timestamp)) {

Review Comment:
   Hi @yihua 
   
   I checked the code, it is safe to return a value 
`Date(0)`/`Date(1)`/`Date(2)` because the places we use 
`HoodieActiveTimeline.parseDateFromInstantTime` and 
`INIT_INSTANT_TS`/`METADATA_BOOTSTRAP_INSTANT_TS `/`FULL_BOOTSTRAP_INSTANT_TS ` 
together are for output metrics. So I updated my code, it will return a 
corresponding value now.
   
   And for clearing this method 
`HoodieActiveTimeline.parseDateFromInstantTime`, I added more comments on it , 
and also update the test case in 
`TestHoodieActiveTimeline.testCreateNewInstantTime`.
   
   Please help to review my code, thanks



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to