[python] Consolidate composite writer lifecycle and file output - #9948
Merged
JingsongLi merged 1 commit intoSep 19, 2026
Merged
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
No unresolved review issues remain.
Pull request overview
Consolidates composite writer lifecycle, metadata preparation, cleanup, and physical format dispatch while preserving retry and file-ownership behavior.
Changes:
- Adds shared
CompositeDataWriterlifecycle handling. - Centralizes format dispatch and metadata handoff.
- Updates writers and tests for retry and metadata ordering.
File summaries
| File | Description |
|---|---|
paimon-python/pypaimon/write/writer/dedicated_format_writer.py |
Uses the consolidated lifecycle and sidecar preparation. |
paimon-python/pypaimon/write/writer/data_writer.py |
Provides shared format dispatch and metadata handoff. |
paimon-python/pypaimon/write/writer/data_vector_writer.py |
Uses the consolidated lifecycle. |
paimon-python/pypaimon/write/writer/composite_data_writer.py |
Implements shared composite writer lifecycle and cleanup. |
paimon-python/pypaimon/tests/write/write_buffer_test.py |
Extends retry and metadata-order coverage. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
|
+1 |
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
Closes #9947.
DataVectorWriterandDedicatedFormatWriterduplicate normal-file output, buffering, rolling checks, and prepare/close handling. Consolidate the shared lifecycle and state inCompositeDataWriter, keeping column splitting, consistency checks, child-writer management, and blob/video-specific rules in the concrete writers. Share physical format dispatch throughDataWriter.Prepare and validate all sidecar metadata before publishing it, then transfer abort cleanup responsibility through
_release_prepared_files(). Preserve metadata ordering, lower-level writer retry behavior, externally owned Blob files, and the cleanup from #9917. No public API change is intended.Tests
BatchTableWrite.prepare_commit()contract is unchanged.Validation baseline:
d0d2dec0ae4c568fd1b1f92d5b77d8376d286196. Benchmark and profiling scripts are outside this patch. No performance improvement is claimed.