Skip to content

feat(storage): support separate zstd level for native parquet logs - #19781

Open
cshuo wants to merge 1 commit into
apache:masterfrom
cshuo:support_native_log_zstd_level
Open

feat(storage): support separate zstd level for native parquet logs#19781
cshuo wants to merge 1 commit into
apache:masterfrom
cshuo:support_native_log_zstd_level

Conversation

@cshuo

@cshuo cshuo commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Describe the issue this Pull Request addresses

Closes #19780.

The global Hadoop parquet.compression.codec.zstd.level setting currently applies to both Parquet base files and native Parquet log files. Native logs favor write latency and may not need the higher compression level selected for base files, but there is no independent native-log setting.

Summary and Changelog

  • Add the advanced hoodie.logfile.parquet.compression.codec.zstd.level configuration with a default value of 1.
  • Add a ParquetUtils helper that applies the native-log level only to native log paths, copying the storage configuration only when the global level is absent or different.
  • Apply the built-in native-log override before HoodieParquetConfigInjector in Spark, Flink, and Avro/Java Parquet writer factories, preserving the custom injector as the highest-priority extension point.
  • Add unit coverage for the default level, explicit override, equal-level configuration reuse, missing global configuration, and unaffected base-file paths.

Impact

Users can tune native Parquet log Zstd compression independently from base files. Native logs default to level 1, while base files retain the global Hadoop setting. This adds one optional advanced configuration and does not change Hudi's storage format or public APIs.

Risk Level

Low. The override is limited to native log paths, base-file paths retain the original configuration instance, and custom Parquet config injectors still run last. The targeted TestParquetUtils#testApplyNativeLogZstdCompressionLevel and Flink Parquet writer factory test passed.

Documentation Update

The new configuration and its default behavior are documented in HoodieStorageConfig. No storage-format documentation changes are required.

Contributor's checklist

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

@codecov-commenter

codecov-commenter commented Aug 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.54839% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.15%. Comparing base (efe02e1) to head (937a22f).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...apache/hudi/common/config/HoodieStorageConfig.java 75.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #19781      +/-   ##
============================================
+ Coverage     78.11%   78.15%   +0.03%     
- Complexity    33673    33695      +22     
============================================
  Files          2540     2540              
  Lines        141413   141441      +28     
  Branches      17123    17126       +3     
============================================
+ Hits         110467   110545      +78     
+ Misses        23250    23200      -50     
  Partials       7696     7696              
Components Coverage Δ
hudi-common 83.55% <75.00%> (-0.02%) ⬇️
hudi-client 83.14% <100.00%> (+0.02%) ⬆️
hudi-flink 85.72% <100.00%> (+0.05%) ⬆️
hudi-spark-datasource 72.69% <ø> (+0.15%) ⬆️
hudi-utilities 74.55% <ø> (+0.05%) ⬆️
hudi-cli 15.06% <ø> (ø)
hudi-hadoop 70.15% <100.00%> (+0.05%) ⬆️
hudi-sync 75.56% <ø> (-0.08%) ⬇️
hudi-io 79.76% <ø> (ø)
hudi-timeline-service 83.44% <ø> (ø)
hudi-cloud 65.81% <ø> (ø)
hudi-kafka-connect 53.20% <ø> (ø)
Flag Coverage Δ
common-and-other-modules 51.48% <74.19%> (+<0.01%) ⬆️
flink-integration-tests 48.89% <85.18%> (+0.03%) ⬆️
hadoop-mr-java-client 44.04% <82.60%> (+0.03%) ⬆️
integration-tests 13.53% <61.29%> (+0.01%) ⬆️
spark-client-hadoop-common 50.39% <77.77%> (+0.01%) ⬆️
spark-java-tests 52.15% <85.18%> (+0.02%) ⬆️
spark-scala-tests 46.74% <85.18%> (+0.01%) ⬆️
utilities 36.31% <85.18%> (+0.02%) ⬆️

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

Files with missing lines Coverage Δ
...io/storage/row/HoodieRowDataFileWriterFactory.java 97.36% <100.00%> (+0.22%) ⬆️
.../hudi/io/storage/HoodieSparkFileWriterFactory.java 80.21% <100.00%> (+0.67%) ⬆️
...java/org/apache/hudi/common/util/ParquetUtils.java 91.86% <100.00%> (+0.45%) ⬆️
...io/storage/hadoop/HoodieAvroFileWriterFactory.java 91.66% <100.00%> (+0.36%) ⬆️
...apache/hudi/common/config/HoodieStorageConfig.java 89.40% <75.00%> (-0.33%) ⬇️

... and 28 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions Bot added the size:M PR with lines of changes in (100, 300] label Aug 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M PR with lines of changes in (100, 300]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SUPPORT] Configure Zstd compression level separately for native Parquet logs

3 participants