Skip to content

refactor(ColumnarArray): change constructor parameter to raw pointer to clarify non-owning semantics#305

Merged
lxy-9602 merged 1 commit into
alibaba:mainfrom
lxy-9602:refactor-columnar-array
May 27, 2026
Merged

refactor(ColumnarArray): change constructor parameter to raw pointer to clarify non-owning semantics#305
lxy-9602 merged 1 commit into
alibaba:mainfrom
lxy-9602:refactor-columnar-array

Conversation

@lxy-9602
Copy link
Copy Markdown
Collaborator

@lxy-9602 lxy-9602 commented May 26, 2026

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 (typically ColumnarBatchContext or the parent arrow container like ListArray/MapArray) must guarantee the lifetime of the pointed-to Array.

Tests

API and Format

Documentation

Generative AI tooling

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ColumnarArray constructor parameter from std::shared_ptr<arrow::Array> to const arrow::Array* and add class-level lifetime documentation.
  • Update ColumnarRow, ColumnarRowRef, ColumnarArray, and ColumnarMap to pass arrow::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.

Comment thread src/paimon/common/data/columnar/columnar_array.h
@lszskye lszskye changed the title refactor: ColumnarArray: change constructor parameter to raw pointer to clarify non-owning semantics refactor(ColumnarArray): change constructor parameter to raw pointer to clarify non-owning semantics May 27, 2026
@lxy-9602 lxy-9602 merged commit 2d5fdbf into alibaba:main May 27, 2026
9 checks passed
lxy-9602 added a commit to lxy-9602/paimon-cpp that referenced this pull request May 28, 2026
lxy-9602 added a commit that referenced this pull request May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants