feat(metadata): Defer RLI initialization for fresh tables to optimize file group allocation#18353
Merged
nsivabalan merged 7 commits intoapache:masterfrom Mar 25, 2026
Merged
Conversation
1242533 to
1a882be
Compare
da1d442 to
28a2b09
Compare
codope
reviewed
Mar 25, 2026
...di-client-common/src/main/java/org/apache/hudi/metadata/HoodieBackedTableMetadataWriter.java
Outdated
Show resolved
Hide resolved
...datasource/hudi-spark/src/test/java/org/apache/hudi/functional/TestHoodieBackedMetadata.java
Outdated
Show resolved
Hide resolved
hudi-common/src/main/java/org/apache/hudi/common/config/HoodieMetadataConfig.java
Outdated
Show resolved
Hide resolved
...datasource/hudi-spark/src/test/java/org/apache/hudi/functional/TestHoodieBackedMetadata.java
Outdated
Show resolved
Hide resolved
hudi-common/src/main/java/org/apache/hudi/common/config/HoodieMetadataConfig.java
Outdated
Show resolved
Hide resolved
Contributor
Author
|
@codope : addressed all feedback |
yihua
reviewed
Mar 25, 2026
Contributor
yihua
left a comment
There was a problem hiding this comment.
The approach of deferring RLI initialization for fresh tables is clean and well-contained. A couple of minor items in the inline comments; the main logic looks sound.
...datasource/hudi-spark/src/test/java/org/apache/hudi/functional/TestHoodieBackedMetadata.java
Show resolved
Hide resolved
...di-client-common/src/main/java/org/apache/hudi/metadata/HoodieBackedTableMetadataWriter.java
Outdated
Show resolved
Hide resolved
yihua
reviewed
Mar 25, 2026
hudi-common/src/main/java/org/apache/hudi/common/config/HoodieMetadataConfig.java
Outdated
Show resolved
Hide resolved
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #18353 +/- ##
=============================================
+ Coverage 57.27% 68.37% +11.09%
- Complexity 18669 27572 +8903
=============================================
Files 1957 2433 +476
Lines 107176 133268 +26092
Branches 13267 16034 +2767
=============================================
+ Hits 61388 91125 +29737
+ Misses 39974 35085 -4889
- Partials 5814 7058 +1244
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Describe the issue this Pull Request addresses
This PR optimizes Record Level Index (RLI) initialization for fresh Hudi tables by deferring RLI bootstrapping to the second commit. This enhancement allows for dynamic file group count determination based on actual data characteristics, improving both performance and resource utilization.
Key Benefits:
Summary and Changelog
Core Implementation (HoodieBackedTableMetadataWriter.java)
Configuration (HoodieMetadataConfig.java)
Testing
Breaking Changes
None - This is a backward-compatible change controlled by an opt-in configuration flag.
Impact
User-facing changes:
hoodie.metadata.record.level.index.defer.for.fresh.table), the RLI partition will not be available after the first commit, but will be available starting from the second commitPerformance impact:
Risk Level
low
Documentation Update
Contributor's checklist