[TASK-432] Typed Column Writers - #440
Merged
Merged
Conversation
Member
Author
There was a problem hiding this comment.
Pull request overview
This PR refactors the Arrow write path to avoid per-value triple dispatch by introducing typed column writers that resolve concrete Arrow builders up-front and write directly from InternalRow.
Changes:
- Adds
row::column_writer::ColumnWriterwith aTypedWriterenum covering supported Fluss scalar types. - Refactors
RowAppendRecordBatchBuilderto useVec<ColumnWriter>instead ofVec<Box<dyn ArrayBuilder>>plusFieldGetter/Datumconversion. - Extracts shared decimal rescaling/append logic into a reusable helper in
row::datum.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| crates/fluss/src/row/mod.rs | Exposes datum crate-wide and adds the new column_writer module. |
| crates/fluss/src/row/datum.rs | Makes time conversion helpers crate-visible and factors out append_decimal_to_builder. |
| crates/fluss/src/row/column_writer.rs | Introduces typed writers to append directly from InternalRow into concrete Arrow builders. |
| crates/fluss/src/record/arrow.rs | Switches row-appending record batch builder to ColumnWriter and updates relevant tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Member
Author
|
Addressed comments |
charlesdong1991
left a comment
Contributor
There was a problem hiding this comment.
very nice PR! just two nit comments
Member
Author
|
@charlesdong1991 Addressed comments, PTAL |
Member
Author
|
fixed clippy warning |
fresh-borzoni
force-pushed
the
typed-column-writers
branch
from
March 11, 2026 10:52
e5e2931 to
ca47fef
Compare
luoyuxia
approved these changes
Mar 11, 2026
luoyuxia
left a comment
Contributor
There was a problem hiding this comment.
@fresh-borzoni Thanks. LGTM. Merging...
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.
Summary
closes #432
Eliminates triple dispatch (FieldGetter enum, Datum allocation, downcast_mut) in the Arrow write path by introducing ColumnWriter, a typed enum that resolves the concrete Arrow builder at construction time and writes directly from InternalRow in a single dispatch.
Changes