Run Hudi compaction on a Merge-on-Read table to merge delta logs into base files and improve read performance

domain: hudi.apache.org · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Understand when compaction is needed: MOR tables accumulate delta log files alongside base Parquet files on each upsert; reads must merge these logs at query time, which degrades performance as log files accumulate; compaction merges logs into new base files
  2. Schedule compaction asynchronously by running a Spark job with hoodie.datasource.write.operation=UPSERT and hoodie.compact.inline=false (the default); then separately trigger compaction scheduling with operation=SCHEDULE_COMPACTION to create a compaction plan
  3. Execute the scheduled compaction plan by running a dedicated Hudi compaction job using the HoodieCompactor class or the hudi-utilities-bundle with spark-submit, referencing the table path; the job runs all pending compaction plans or a specific instant
  4. Alternatively, enable inline compaction by setting hoodie.compact.inline=true and hoodie.compact.inline.max.delta.commits=<N> so compaction runs automatically after N delta commits — simpler but blocks the write pipeline during compaction
  5. After compaction, verify by checking the .hoodie timeline for compaction instants with state=completed and then querying the table; the number of log files per partition should decrease substantially

Known gotchas

Related routes

Run Hudi compaction and clustering to optimize a Merge-on-Read table for read performance
hudi.apache.org · 5 steps · unrated
Configure a Hudi Merge-on-Read table and understand the read path differences from Copy-on-Write
hudi.apache.org · 5 steps · unrated
Configure a Hudi Record-Level Index (RLI) to accelerate upsert lookup performance on large tables
hudi.apache.org · 5 steps · unrated

Give your agent this knowledge — and 15,600+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans