davehagman commented on a change in pull request #3824:
URL: https://github.com/apache/hudi/pull/3824#discussion_r736766669



##########
File path: 
hudi-common/src/main/java/org/apache/hudi/common/table/timeline/HoodieActiveTimeline.java
##########
@@ -74,6 +84,43 @@
   protected HoodieTableMetaClient metaClient;
   private static AtomicReference<String> lastInstantTime = new 
AtomicReference<>(String.valueOf(Integer.MIN_VALUE));
 
+  /**
+   * Parses the given instant ID to return a date instance.
+   * @param instant The instant ID
+   * @return A date
+   * @throws ParseException If the instant ID is malformed
+   */
+  public static Date parseDateFromInstantTime(String instant) throws 
ParseException {
+    // Enables backwards compatibility with non-millisecond granularity 
instants
+    if (isMillisecondGranularity(instant)) {
+      return COMMIT_FORMATTER.parse(instant);
+    } else {
+      // Add milliseconds to the instant in order to parse successfully
+      return COMMIT_FORMATTER.parse(instant + "000");

Review comment:
       Good catch. Fixed




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