Skip to content

fix: [HUDI-3055] Fix hardcoded GZIP compression codec in HFileUtils#18263

Merged
voonhous merged 1 commit intoapache:masterfrom
ZZZxDong:fix-hfileutils-compression-codec
Mar 31, 2026
Merged

fix: [HUDI-3055] Fix hardcoded GZIP compression codec in HFileUtils#18263
voonhous merged 1 commit intoapache:masterfrom
ZZZxDong:fix-hfileutils-compression-codec

Conversation

@ZZZxDong
Copy link
Copy Markdown
Contributor

@ZZZxDong ZZZxDong commented Feb 28, 2026

Describe the issue this Pull Request addresses

Fix issue #14963: Ensure that compression codec configuration is respected across the board.

Changes here only affect routes when codec is null or empty, hence default value should be respected.

Summary and Changelog

  • Modified HFileUtils.getHFileCompressionAlgorithm() to use HFILE_COMPRESSION_ALGORITHM_NAME.defaultValue() instead of hardcoding CompressionCodec.GZIP
  • This ensures the method respects the configured compression codec default value

Verify this pull request

This pull request is already covered by existing tests:

  • TestHFileUtils.testGetHFileCompressionAlgorithm() - tests all compression codecs
  • TestHFileUtils.testGetHFileCompressionAlgorithmWithEmptyString() - tests empty string case
  • TestHFileUtils.testGetDefaultHFileCompressionAlgorithm() - tests default value case

Impact

Ensure that compression codec configuration is respected across the board, Hfile uses hfile default compression for now.

Risk Level

None

Documentation Update

None

Contributor's checklist

  • Read through contributor's guide
  • Enough context is provided in the sections above
  • Adequate tests were added if applicable

Use configuration default value instead of hardcoding CompressionCodec.GZIP
in getHFileCompressionAlgorithm method to respect user's compression config.

Existing tests in TestHFileUtils already cover this change.
@github-actions github-actions Bot added the size:XS PR with lines of changes in <= 10 label Feb 28, 2026
@hudi-bot
Copy link
Copy Markdown
Collaborator

CI report:

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

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 57.30%. Comparing base (d4ff54b) to head (90c1f17).
⚠️ Report is 48 commits behind head on master.

Files with missing lines Patch % Lines
...n/java/org/apache/hudi/common/util/HFileUtils.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             master   #18263    +/-   ##
==========================================
  Coverage     57.30%   57.30%            
- Complexity    18580    18596    +16     
==========================================
  Files          1947     1948     +1     
  Lines        106396   106497   +101     
  Branches      13153    13160     +7     
==========================================
+ Hits          60967    61025    +58     
- Misses        39680    39719    +39     
- Partials       5749     5753     +4     
Flag Coverage Δ
hadoop-mr-java-client 45.36% <0.00%> (+0.02%) ⬆️
spark-java-tests 47.46% <0.00%> (+0.02%) ⬆️
spark-scala-tests 45.54% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...n/java/org/apache/hudi/common/util/HFileUtils.java 40.69% <0.00%> (ø)

... and 14 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@voonhous voonhous changed the title [HUDI-3055] Fix hardcoded GZIP compression codec in HFileUtils fix: [HUDI-3055] Fix hardcoded GZIP compression codec in HFileUtils Mar 29, 2026
@voonhous voonhous changed the title fix: [HUDI-3055] Fix hardcoded GZIP compression codec in HFileUtils fix: Fix hardcoded GZIP compression codec in HFileUtils [HUDI-3055] Mar 29, 2026
@voonhous voonhous changed the title fix: Fix hardcoded GZIP compression codec in HFileUtils [HUDI-3055] fix: [HUDI-3055] Fix hardcoded GZIP compression codec in HFileUtils Mar 29, 2026
@voonhous voonhous merged commit bef0c54 into apache:master Mar 31, 2026
79 of 84 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS PR with lines of changes in <= 10

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants