hudi-cli: metadata stats always prints an empty table

Open Beginner friendly
#19,880 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
java, spark

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.

Description

type:bug
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 <table> 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.

Dominant language
Java
Stars
6.3k
Forks
2.5k
Avg merge
2d 5h
Merged PRs (30d)
111

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/hudi

All issues in apache/hudi

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.