danny0405 commented on code in PR #8607:
URL: https://github.com/apache/hudi/pull/8607#discussion_r1181156586


##########
hudi-common/src/main/java/org/apache/hudi/common/table/timeline/HoodieArchivedTimeline.java:
##########
@@ -152,9 +156,13 @@ public void loadCompactionDetailsInMemory(String 
compactionInstantTime) {
 
   public void loadCompactionDetailsInMemory(String startTs, String endTs) {
     // load compactionPlan
-    loadInstants(new TimeRangeFilter(startTs, endTs), true, record ->
-        
record.get(ACTION_TYPE_KEY).toString().equals(HoodieTimeline.COMPACTION_ACTION)
-            && 
HoodieInstant.State.INFLIGHT.toString().equals(record.get(ACTION_STATE).toString())
+    loadInstants(new TimeRangeFilter(startTs, endTs), true,
+        record -> {
+          // Older files don't have action state set.
+          Object action = record.get(ACTION_STATE);
+          return 
record.get(ACTION_TYPE_KEY).toString().equals(HoodieTimeline.COMPACTION_ACTION)
+            && (action == null || 
HoodieInstant.State.INFLIGHT.toString().equals(action.toString()));

Review Comment:
   When action equals null, the instant state is definite to be `INFLIGHT` for 
old version ? Can we write ta test case?



##########
hudi-common/src/main/java/org/apache/hudi/common/table/timeline/HoodieArchivedTimeline.java:
##########
@@ -143,7 +143,11 @@ public void loadInstantDetailsInMemory(String startTs, 
String endTs) {
 
   public void loadCompletedInstantDetailsInMemory() {
     loadInstants(null, true,
-        record -> 
HoodieInstant.State.COMPLETED.toString().equals(record.get(ACTION_STATE).toString()));
+        record -> {
+          // Very old archived instants don't have action state set.
+          Object action = record.get(ACTION_STATE);
+          return action == null || 
HoodieInstant.State.COMPLETED.toString().equals(action.toString());

Review Comment:
   When action equals null, the instant state is definite to be `COMPLETE` for 
old version ? Can we write ta test case?



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