refactor(ColumnarArray): change constructor parameter to raw pointer to clarify non-owning semantics#305
Merged
Conversation
…to clarify non-owning semantics
There was a problem hiding this comment.
Pull request overview
This PR updates the internal columnar wrapper ColumnarArray to make its non-owning semantics explicit by changing its constructor to accept a const arrow::Array* and documenting the lifetime expectations. It then updates relevant call sites and unit tests to pass raw pointers obtained from Arrow-owned shared_ptrs.
Changes:
- Change
ColumnarArrayconstructor parameter fromstd::shared_ptr<arrow::Array>toconst arrow::Array*and add class-level lifetime documentation. - Update
ColumnarRow,ColumnarRowRef,ColumnarArray, andColumnarMapto passarrow::Array*via.get(). - Update affected unit tests to match the new constructor signature.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/paimon/common/data/columnar/columnar_row.cpp | Update list element array construction to pass raw Arrow pointer. |
| src/paimon/common/data/columnar/columnar_row_ref.cpp | Update list element array construction to pass raw Arrow pointer. |
| src/paimon/common/data/columnar/columnar_map.cpp | Update key/value array wrappers to pass raw Arrow pointers. |
| src/paimon/common/data/columnar/columnar_array.h | Change constructor signature to raw pointer and document non-owning lifetime semantics. |
| src/paimon/common/data/columnar/columnar_array.cpp | Update nested list array wrapping to pass raw Arrow pointer. |
| src/paimon/common/data/columnar/columnar_array_test.cpp | Update tests to pass raw pointers via .get(). |
| src/paimon/common/data/binary_array_test.cpp | Update tests to pass raw pointers via .get(). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
lszskye
approved these changes
May 27, 2026
lxy-9602
added a commit
to lxy-9602/paimon-cpp
that referenced
this pull request
May 28, 2026
…to clarify non-owning semantics (alibaba#305)
lxy-9602
added a commit
that referenced
this pull request
May 28, 2026
…to clarify non-owning semantics (#305)
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
No Linked issue.
This PR changes the constructor parameter to
const arrow::Array*to make the non-owning semantics explicit at the API level, and adds a class-level comment documenting that the caller (typicallyColumnarBatchContextor the parent arrow container likeListArray/MapArray) must guarantee the lifetime of the pointed-to Array.Tests
API and Format
Documentation
Generative AI tooling