-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[HUDI-6196] Keep compatibility for old version archival instants without ACTION_STATE field #8607
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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()); | ||
| }); | ||
| } | ||
|
|
||
| public void loadCompactionDetailsInMemory(String compactionInstantTime) { | ||
|
|
@@ -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())); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When action equals null, the instant state is definite to be
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| } | ||
| ); | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
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
COMPLETEfor old version ? Can we write ta test case?