You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "nsivabalan (via GitHub)" <gi...@apache.org> on 2026/06/25 02:16:27 UTC
Re: [I] Programmatic way to fetch earliest commit retained [hudi]
nsivabalan commented on issue #14727:
URL: https://github.com/apache/hudi/issues/14727#issuecomment-4795240532
Hi — this looks resolved on current master. There are several programmatic ways to fetch the earliest commit retained:
- **Java API**: read the latest completed clean from the timeline and call `HoodieCleanMetadata.getEarliestCommitToRetain()`. The static helper `CleanerUtils.getEarliestCommitToRetain(...)` in `hudi-common` also computes it on demand from a timeline + cleaning policy.
- **Spark SQL**: `CALL show_cleans(table => '<your_table>')` returns an `earliest_commit_to_retain` column (added via HUDI-9653, commit e11ee97662ef). `show_cleans_metadata` provides the per-partition view.
- **CLI**: `cleans show` prints the earliest commit retained for each clean.
For GDPR/erasure workflows, the typical pattern is: read `HoodieCleanMetadata` from the latest completed `.clean` instant on the active timeline (or the archived timeline if cleaned-up commits have been archived), then use `getEarliestCommitToRetain()` as the bound. Closing as covered — please reopen if a different surface (e.g. metaserver/REST endpoint) is what you need.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org