Skip to content

GH-38184: [C++] Add systematic tests for Builder::AppendArraySlice#49132

Merged
pitrou merged 5 commits intoapache:mainfrom
abhishek593:feature/test-builder-append-slice
Feb 18, 2026
Merged

GH-38184: [C++] Add systematic tests for Builder::AppendArraySlice#49132
pitrou merged 5 commits intoapache:mainfrom
abhishek593:feature/test-builder-append-slice

Conversation

@abhishek593
Copy link
Contributor

@abhishek593 abhishek593 commented Feb 3, 2026

Rationale for this change

Introduce systematic test coverage for arrow::ArrayBuilder::AppendArraySlice across all major Arrow data types to ensure correctness for diverse physical layouts.

What changes are included in this PR?

  • Added 30 new test cases covering Primitives, Binary/String, Lists (including Views), Structs, Unions, Decimals, and REE types.
  • Added specialized logical equality validation for Dictionary arrays.

Are these changes tested?

Yes, all 30 new cases passed locally with varying null probabilities.

Are there any user-facing changes?

No.

Copy link
Member

@pitrou pitrou left a comment

Choose a reason for hiding this comment

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

Thanks for tackling this @abhishek593 . Here are a couple comments to improve this PR.

TYPED_TEST_SUITE(TestBuilderAppendArraySliceBinary, BinaryAppendArraySliceTypes);
TYPED_TEST(TestBuilderAppendArraySliceBinary, Binary) {
this->CheckAppendArraySlice(TypeTraits<TypeParam>::type_singleton());
}
Copy link
Member

Choose a reason for hiding this comment

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

We don't actually need templating, we can just generate the types dynamically using PrimitiveTypes(), BaseBinaryTypes() etc. This will reduce code generation and compile times slightly.

Copy link
Member

Choose a reason for hiding this comment

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

Besides, we should also test binary_view and string_view types.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. BaseBinaryTypes, binary_view, string_view, etc. is already present in PrimitiveTypes.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks. Is there a particular reason for keeping the other test functions separate?

Organisation-wise, we should either have one single test function with all types, or have more granular test functions for the "dynamic" types as well (one for primitives, one for temporals etc.).

I'll leave it to your preference :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, particular reason. I simply incorporated the feedback given previously. I agree with better organisation of tests, so I have grouped the tests better now.

@github-actions github-actions bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Feb 17, 2026
@abhishek593 abhishek593 requested a review from pitrou February 18, 2026 08:03
Copy link
Member

@pitrou pitrou left a comment

Choose a reason for hiding this comment

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

+1, thanks for the updates @abhishek593

@pitrou
Copy link
Member

pitrou commented Feb 18, 2026

@github-actions crossbow submit -g cpp

@github-actions
Copy link

Revision: 06f00c7

Submitted crossbow builds: ursacomputing/crossbow @ actions-c25aa1acd5

Task Status
example-cpp-minimal-build-static GitHub Actions
example-cpp-minimal-build-static-system-dependency GitHub Actions
example-cpp-tutorial GitHub Actions
test-build-cpp-fuzz GitHub Actions
test-conda-cpp GitHub Actions
test-conda-cpp-valgrind GitHub Actions
test-debian-13-cpp-amd64 GitHub Actions
test-debian-13-cpp-i386 GitHub Actions
test-debian-experimental-cpp-gcc-15 GitHub Actions
test-fedora-42-cpp GitHub Actions
test-ubuntu-22.04-cpp GitHub Actions
test-ubuntu-22.04-cpp-20 GitHub Actions
test-ubuntu-22.04-cpp-bundled GitHub Actions
test-ubuntu-22.04-cpp-emscripten GitHub Actions
test-ubuntu-22.04-cpp-no-threading GitHub Actions
test-ubuntu-24.04-cpp GitHub Actions
test-ubuntu-24.04-cpp-bundled-offline GitHub Actions
test-ubuntu-24.04-cpp-gcc-13-bundled GitHub Actions
test-ubuntu-24.04-cpp-gcc-14 GitHub Actions
test-ubuntu-24.04-cpp-minimal-with-formats GitHub Actions
test-ubuntu-24.04-cpp-thread-sanitizer GitHub Actions

@pitrou
Copy link
Member

pitrou commented Feb 18, 2026

CI failure is unrelated, I'll merge.

@pitrou pitrou merged commit 6080027 into apache:main Feb 18, 2026
55 of 56 checks passed
@pitrou pitrou removed the awaiting committer review Awaiting committer review label Feb 18, 2026
@conbench-apache-arrow
Copy link

After merging your PR, Conbench analyzed the 1 benchmarking run that has been run so far on merge-commit 6080027.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about 3 possible false positives for unstable benchmarks that are known to sometimes produce them.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments