Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

});
}

public void loadCompactionDetailsInMemory(String compactionInstantTime) {
Expand All @@ -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()));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

old version is deprecated/fixed so dont know how to write unit tests for them.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine, we are good to go, I did see several issues with this in-compatibility, let's merge it first.

}
);
}

Expand Down