Skip to content

Conversation

@prashantwason
Copy link
Member

[MINOR] Fixed the reading of instants from very old archive files where ACTION_STATE is not present in instants.

Change Logs

Ensure that ACTION_STATE exists in the record before performing the equals comparison.

Impact

Very old archive files can be read.

Risk level (write none, low medium or high below)

None

Documentation Update

None

Contributor's checklist

  • Read through contributor's guide
  • Change Logs and Impact were stated clearly
  • Adequate tests were added if applicable
  • CI passed

@hudi-bot
Copy link
Collaborator

CI report:

Bot commands @hudi-bot supports the following commands:
  • @hudi-bot run azure re-run the last Azure build

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

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?

@danny0405 danny0405 changed the title [MINOR] Fixed the reading of instants from very old archive files where ACTION_STATE is not present in instants. [HUDI-6196] Keep compatibility for old version archival instants without ACTION_STATE field May 10, 2023
@danny0405 danny0405 merged commit 9379474 into apache:master May 10, 2023
yihua pushed a commit to yihua/hudi that referenced this pull request May 15, 2023
yihua pushed a commit to yihua/hudi that referenced this pull request May 15, 2023
yihua pushed a commit to yihua/hudi that referenced this pull request May 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants