feat(comapct): Implement AppendCompactCoordinator for append-only unaware-bucket table compaction#238
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Implements a new synchronous compaction entry point for append-only tables in UNAWARE_BUCKET mode (bucket = -1), scanning the latest snapshot for small files and rewriting them into compacted outputs.
Changes:
- Added
AppendCompactCoordinator::Run()public API to scan small files, bin-pack them into tasks, and synchronously execute compaction rewrites. - Introduced
AppendCompactTaskto perform the rewrite viaAppendOnlyFileStoreWrite::CompactRewrite()and emitCommitMessage/CompactIncrement. - Added comprehensive unit tests for coordinator behavior (partition filtering, validation failures, external paths, size thresholds, schema evolution).
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/paimon/core/operation/append_only_file_store_write.h | Exposes CompactRewrite as a public method for coordinator/task usage. |
| include/paimon/append/append_compact_coordinator.h | Adds new public API for append-only unaware-bucket compaction. |
| src/paimon/core/append/append_compact_coordinator.cpp | Implements snapshot scan, bin-packing, task generation, and synchronous execution. |
| src/paimon/core/append/append_compact_task.{h,cpp} | Defines/executes a single compaction rewrite task and builds commit messages. |
| src/paimon/core/append/append_compact_coordinator_test.cpp | Adds UT coverage for coordinator end-to-end scenarios and validations. |
| src/paimon/CMakeLists.txt | Wires new sources and test into the build. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
lucasfang
reviewed
Apr 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Linked issue: #93
Implement
AppendCompactCoordinatorfor synchronous compaction of append-only unaware-bucket tables (bucket=-1).Key components:
AppendOnlyFileStoreWrite.EnoughContent(totalFileSize >= targetFileSize * 2) orEnoughInputFiles(count >= minFileNum).TODO: DV (deletion vectors) is not yet supported in UNAWARE_BUCKET mode.
Tests
AppendCompactCoordinatorTest
API and Format
Add
AppendCompactCoordinator ::Run()Documentation
Generative AI tooling
Generated-by: Claude-4.6-Opus