waterWang opened a new pull request, #19588:
URL: https://github.com/apache/hudi/pull/19588

   Adds two new hudi-cli commands (`checkpoint get` and `checkpoint set`) that 
allow operators to inspect and modify the ingestion checkpoint value stored in 
a Hudi table's commit metadata — without manually parsing or editing commit 
metadata JSON files.
   
   ## Changes
   
   ### `checkpoint get`
   Reads the latest ingestion instant from the active timeline and displays the 
checkpoint value along with commit statistics (timestamp, action, state, 
records/bytes/partitions/files written).
   
   ### `checkpoint set`
   Safely overwrites the checkpoint value in the latest completed ingestion 
commit's metadata. Supports both DeltaStreamer checkpoints (default) and 
arbitrary custom checkpoint keys (e.g. `latest-ingestion-timestamp`). Includes 
safety guardrails:
   - Requires explicit `--force true` confirmation
   - Backs up the original commit file to `.checkpoint_backup/` before 
modification
   - Verifies the write by re-reading the timeline
   - Preserves the backup for manual recovery on failure
   
   ### Parameters
   
   | Parameter | Description | Default |
   |---|---|---|
   | `--checkpointValue` | The new checkpoint value to set | (required) |
   | `--isDeltaStreamer` | Whether to target the DeltaStreamer checkpoint key | 
`true` |
   | `--customCheckpointKey` | Custom checkpoint key name (used when 
`isDeltaStreamer=false`) | `""` |
   | `--force` | Bypass the safety confirmation warning | `false` |
   
   ### Usage examples
   
   ```bash
   # Connect to table
   connect --path hdfs:///path/to/table
   
   # Inspect current checkpoint
   checkpoint get
   
   # Set DeltaStreamer checkpoint
   checkpoint set --checkpointValue 20251021164840000 --force true
   
   # Set a custom checkpoint key
   checkpoint set --checkpointValue 20251021164840000 --isDeltaStreamer false 
--customCheckpointKey latest-ingestion-timestamp --force true
   ```
   
   This addresses the feature request in #19577.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to