Skip to content

feat(cli): add compact analyze and compact run commands#903

Merged
zeroshade merged 2 commits into
apache:mainfrom
laskoviymishka:feat/cli-compact
Apr 15, 2026
Merged

feat(cli): add compact analyze and compact run commands#903
zeroshade merged 2 commits into
apache:mainfrom
laskoviymishka:feat/cli-compact

Conversation

@laskoviymishka
Copy link
Copy Markdown
Contributor

Add iceberg compact analyze TABLE_ID for dry-run compaction planning and iceberg compact run TABLE_ID for executing bin-pack compaction.

  • Plans via compaction.Analyze, executes via Transaction.RewriteDataFiles
  • Flags: --target-file-size, --partial-progress
  • Prints per-group breakdown table with partition, file count, size, deletes
  • Partial progress message printed before fatal error on failure

Part of #832 (table compaction).

Add `iceberg compact analyze TABLE_ID` for dry-run compaction planning
and `iceberg compact run TABLE_ID` for executing bin-pack compaction.

- Plans via compaction.Analyze, executes via Transaction.RewriteDataFiles
- Flags: --target-file-size, --partial-progress
- Prints per-group breakdown table with partition, file count, size, deletes
- Partial progress message printed before fatal error on failure

Part of apache#832 (table compaction).
@laskoviymishka laskoviymishka marked this pull request as ready for review April 15, 2026 11:38
Copy link
Copy Markdown
Member

@zeroshade zeroshade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one question/nitpick

Comment thread cmd/iceberg/compact.go Outdated
Print the compaction plan summary and per-group table regardless
of whether the user ran 'analyze' or 'run'. This gives users
visibility into what will be compacted before it actually happens.
@zeroshade zeroshade merged commit 40c3363 into apache:main Apr 15, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants