You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2021/11/11 18:26:06 UTC

[GitHub] [hudi] vinothchandar commented on a change in pull request #3976: [HUDI-2744] Fixing parsing of metadadata table compaction timestamp

vinothchandar commented on a change in pull request #3976:
URL: https://github.com/apache/hudi/pull/3976#discussion_r747725444



##########
File path: hudi-common/src/main/java/org/apache/hudi/common/table/timeline/HoodieInstantTimeGenerator.java
##########
@@ -65,6 +71,12 @@ public static Date parseInstantTime(String timestamp) {
       if (timestamp.equals(ALL_ZERO_TIMESTAMP)) {
         return new Date(0);
       }
+      // compaction and cleaning in metadata has special format. handling it here.
+      if (timestamp.length() == MILLIS_INSTANT_ID_LENGTH) {

Review comment:
       btw this is not just millisecond format. its going to add `001` to the millisecond format once you land that

##########
File path: hudi-common/src/main/java/org/apache/hudi/common/table/timeline/HoodieInstantTimeGenerator.java
##########
@@ -35,6 +37,10 @@
   private static final String INSTANT_TIMESTAMP_FORMAT = "yyyyMMddHHmmss";
   // Formatter to generate Instant timestamps
   private static DateTimeFormatter INSTANT_TIME_FORMATTER = DateTimeFormatter.ofPattern(INSTANT_TIMESTAMP_FORMAT);
+  private static final String MILLIS_COMMIT_FORMAT = "yyyyMMddHHmmssSSS";
+  private static final int MILLIS_INSTANT_ID_LENGTH = MILLIS_COMMIT_FORMAT.length();
+  // Formatter to generate Instant timestamps for millsecs format
+  private static final SimpleDateFormat MILLIS_COMMIT_FORMATTER = new SimpleDateFormat(MILLIS_COMMIT_FORMAT);

Review comment:
       lets just use `DateTimeFormatter` uniformly?

##########
File path: hudi-common/src/main/java/org/apache/hudi/common/table/timeline/HoodieInstantTimeGenerator.java
##########
@@ -35,6 +37,10 @@
   private static final String INSTANT_TIMESTAMP_FORMAT = "yyyyMMddHHmmss";
   // Formatter to generate Instant timestamps
   private static DateTimeFormatter INSTANT_TIME_FORMATTER = DateTimeFormatter.ofPattern(INSTANT_TIMESTAMP_FORMAT);
+  private static final String MILLIS_COMMIT_FORMAT = "yyyyMMddHHmmssSSS";

Review comment:
       MILLIS_INSTANT_TIME_FORMAT?




-- 
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-unsubscribe@hudi.apache.org

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