[HUDI-8543] Fixing SI MDT record generation in MDT to not rely on RDD<WriteStatus> #12291
+918
−83
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Change Logs
Fixing SI MDT record generation in MDT to not rely on RDD
This is a stacked patch over #12269
This is the 2nd patch among series of patch.
In this patch, we are making SI to not rely on RDD.
SI needs to know what record keys have been deleted or updated so that it can delete those entries from SI. We are only adjusting this to not depend on the writeStatus.
We had to make some changes to our RLI and SI records are generated.
We do not want to read from data files repeatedly(once for RLI and again for SI). And so, here is what we are doing.
Step1: For every HoodieWriteStat in the HoodieCommitMetadata, we are generating PerFileGroupRecordKeyInfos which contains
where RecordStatus is an enum with INSERT or UPDATE or DELETE
Incase of parquet file:
Incase of log files:
Step2:
Persist the output from Step1. (PairRDD)
Step 3:
Step4:
Essentially, at a high level, we do one processing of data files to populate PerFileGroupRecordKeyInfos for every HoodieWriteStat (i.e. every partition, fileId combination).
And then use the paired RDD to compute RLI and SI records.
Pending:
I need to write more tests. But most of existing tests for RLI and SI except 1 which I am investigating.
Impact
No non-determinism or undefined behavior for RLI and SI is fixed.
Risk level (write none, low medium or high below)
low
Documentation Update
Describe any necessary documentation update if there is any new feature, config, or user-facing change. If not, put "none".
ticket number here and follow the instruction to make
changes to the website.
Contributor's checklist