feat(inspect): add ArrowRowBuilder for materializing Arrow batches#780
Open
WZhuo wants to merge 1 commit into
Open
feat(inspect): add ArrowRowBuilder for materializing Arrow batches#780WZhuo wants to merge 1 commit into
WZhuo wants to merge 1 commit into
Conversation
Add ArrowRowBuilder (inspect/row_builder_internal) to materialize in-memory rows into an ArrowArray for an arbitrary Iceberg schema, with typed append helpers (AppendNull/Boolean/Int/String/StringMap) reused by later metadata tables.
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
Adds
ArrowRowBuilder(inspect/row_builder_internal), a schema-driven helper that materializes in-memory rows into an ArrowArrowArray(a batch) for an arbitrary Iceberg schema. It wraps the nanoarrow boilerplate and exposes per-column access plus typed append helpers, so metadata tables (snapshots, history, manifests, …) can emit rows without re-implementing it.This is the first of a series splitting metadata-table support into focused PRs; the
InMemoryBatchReaderand theSnapshotsTable::Scanintegration are intended to follow in separate PRs that build on this.What's included
ArrowRowBuilder::Make/column/FinishRow/Finishand typed helpersAppendNull/AppendBoolean/AppendInt/AppendString/AppendStringMap.iceberglibrary — it only needs nanoarrow +ToArrowSchema(no Apache Arrow), matching peers likemanifest_adapterandarrow_c_data_util.row_builder_test.cccovering typed appends (int32/string/int64/boolean/map), null handling for optional columns, multi-entry/empty string maps, zero-row batches, and column-index bounds. Compiled into themetadata_table_testtarget.Testing
cmake --build build --target metadata_table_testthen ran it — 9/9 tests pass (4 existingMetadataTableTest+ 5 newArrowRowBuilderTest).ctestgreen.arrow::ImportRecordBatch), so its target isUSE_BUNDLE.Notes
metadata_table_test.cccontinues to build there.