hudi-cli: metadata stats always prints an empty table
- Dominant language
- Java
- Stars
- 6.2k
- Forks
- 2.5k
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 111
Description
### Bug Description
**What happened:**
`metadata stats` in hudi-cli always prints an empty table. `MetadataCommand.stats` (master 6ac27904, `MetadataCommand.java:192-194`) opens the metadata table with `HoodieMetadataConfig.newBuilder().enable(true).build()` and no metrics configuration, so `HoodieBackedTableMetadata.stats()` returns an empty map and the loop that renders the rows never runs.
**What you expected:**
The command reports the metadata table stats it was written to show (partition count, file count, sizes), or it is removed if the stats are no longer produced.
**Steps to reproduce:**
1. Write a table with the metadata table enabled.
2. `connect --path ` then `metadata stats`.
3. Only the header row is printed.
Found while writing the tests in #19877; the test there asserts the empty table as the current behaviour.
### Environment
**Hudi version:** master (6ac27904)
**Query engine:** hudi-cli (Spark)
**Relevant configs:** none
### Logs and Stack Trace
No exception; the rendered table has a header and no rows.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at MetadataCommand.java:192-194 and inspect MetadataCommand.stats, then follow HoodieBackedTableMetadata.stats() to understand why the opened metadata table returns no metrics. Reproduce with a metadata-enabled table and `metadata stats`, then update the behavior and the test referenced in #19877 so the command reports the intended stats or confirms their removal.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spark
- Domain
- cli, data-engineering
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100