Skip to content

GH-29309: [C++] Preserve BinaryBuilder data type#50049

Open
BITree2004 wants to merge 1 commit into
apache:mainfrom
BITree2004:ARROW-29309-binary-builder-type
Open

GH-29309: [C++] Preserve BinaryBuilder data type#50049
BITree2004 wants to merge 1 commit into
apache:mainfrom
BITree2004:ARROW-29309-binary-builder-type

Conversation

@BITree2004
Copy link
Copy Markdown

@BITree2004 BITree2004 commented May 27, 2026

Rationale for this change

BinaryBuilder accepted a DataType in its constructor but discarded it, so finishing through ArrayBuilder::Finish() always produced a plain binary array instead of preserving the supplied type, such as an extension type backed by binary storage.

What changes are included in this PR?

  • Store the supplied DataType in BaseBinaryBuilder.
  • Use the stored type for BinaryBuilder and LargeBinaryBuilder output.
  • Add a regression test covering BinaryBuilder with a binary-backed extension type.

Are these changes tested?

Yes.

ninja -C cpp/build arrow-array-test
./cpp/build/release/arrow-array-test --gtest_filter=BinaryBuilder.PreservesDataType
./cpp/build/release/arrow-array-test
* GitHub Issue: #29309

@github-actions
Copy link
Copy Markdown

⚠️ GitHub issue #29309 has been automatically assigned in GitHub to PR creator.

@github-actions
Copy link
Copy Markdown

⚠️ GitHub issue #29309 has been automatically assigned in GitHub to PR creator.

1 similar comment
@github-actions
Copy link
Copy Markdown

⚠️ GitHub issue #29309 has been automatically assigned in GitHub to PR creator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant