Skip to content

GH-48588 [C++] Migrate to stdlib span#49492

Open
Anakin100100 wants to merge 4 commits intoapache:mainfrom
Anakin100100:feature/migrate-to-stdlib-span
Open

GH-48588 [C++] Migrate to stdlib span#49492
Anakin100100 wants to merge 4 commits intoapache:mainfrom
Anakin100100:feature/migrate-to-stdlib-span

Conversation

@Anakin100100
Copy link
Contributor

@Anakin100100 Anakin100100 commented Mar 10, 2026

Rationale for this change

C++ 20 already includes a span implementation so there is no reason to maintain a custom one in utils as described in #48588

What changes are included in this PR?

arrow::utils::span definition and tests are removed and usages are replaced with std::span. Some span comparisons in tests are replaced from ASSERT_EQ to ASSERT_TRUE(std::ranges::equal(span1, span2)) because ASSERT_EQ inernally relies on == operator which is not defined for some types that we used to compare.

Are these changes tested?

Yes

Are there any user-facing changes?

No

@Anakin100100 Anakin100100 requested a review from wgtmac as a code owner March 10, 2026 20:52
@github-actions
Copy link

Thanks for opening a pull request!

If this is not a minor PR. Could you open an issue for this pull request on GitHub? https://github.com/apache/arrow/issues/new/choose

Opening GitHub issues ahead of time contributes to the Openness of the Apache Arrow project.

Then could you also rename the pull request title in the following format?

GH-${GITHUB_ISSUE_ID}: [${COMPONENT}] ${SUMMARY}

or

MINOR: [${COMPONENT}] ${SUMMARY}

See also:

@Anakin100100 Anakin100100 changed the title Initial draft GH-48588 [C++] Migrate to stdlib span Mar 10, 2026
@github-actions github-actions bot added the awaiting review Awaiting review label Mar 10, 2026
@Anakin100100
Copy link
Contributor Author

@pitrou can you take a look at this pr? It looks like the other one wasn't going to be finished and was stale so I made this one.

@pitrou
Copy link
Member

pitrou commented Mar 18, 2026

@github-actions crossbow submit -g cpp

@pitrou
Copy link
Member

pitrou commented Mar 18, 2026

@github-actions crossbow submit cran

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@pitrou
Copy link
Member

pitrou commented Mar 18, 2026

@Anakin100100 Can you rebase from main so that we try and get CI to pass?

@pitrou
Copy link
Member

pitrou commented Mar 18, 2026

@github-actions crossbow submit cran

@pitrou
Copy link
Member

pitrou commented Mar 18, 2026

@github-actions crossbow submit -g cpp

@pitrou
Copy link
Member

pitrou commented Mar 18, 2026

@github-actions crossbow submit wheelcp314*

@github-actions
Copy link

Revision: 07ffe66

Submitted crossbow builds: ursacomputing/crossbow @ actions-a82b4a5a3f

Task Status
test-r-alpine-linux-cran GitHub Actions
test-r-linux-as-cran GitHub Actions
test-r-macos-as-cran GitHub Actions

@github-actions
Copy link

Revision: 07ffe66

Submitted crossbow builds: ursacomputing/crossbow @ actions-e33421a69f

Task Status
wheel-macos-monterey-cp314-cp314-amd64 GitHub Actions
wheel-macos-monterey-cp314-cp314-arm64 GitHub Actions
wheel-macos-monterey-cp314-cp314t-amd64 GitHub Actions
wheel-macos-monterey-cp314-cp314t-arm64 GitHub Actions
wheel-manylinux-2-28-cp314-cp314-amd64 GitHub Actions
wheel-manylinux-2-28-cp314-cp314-arm64 GitHub Actions
wheel-manylinux-2-28-cp314-cp314t-amd64 GitHub Actions
wheel-manylinux-2-28-cp314-cp314t-arm64 GitHub Actions
wheel-musllinux-1-2-cp314-cp314-amd64 GitHub Actions
wheel-musllinux-1-2-cp314-cp314-arm64 GitHub Actions
wheel-musllinux-1-2-cp314-cp314t-amd64 GitHub Actions
wheel-musllinux-1-2-cp314-cp314t-arm64 GitHub Actions
wheel-windows-cp314-cp314-amd64 GitHub Actions
wheel-windows-cp314-cp314t-amd64 GitHub Actions

@github-actions
Copy link

Revision: 07ffe66

Submitted crossbow builds: ursacomputing/crossbow @ actions-43b13ce765

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 pitrou added CI: Extra: C++ Run extra C++ CI CI: Extra: R Run extra R CI labels Mar 18, 2026
@pitrou
Copy link
Member

pitrou commented Mar 18, 2026

@WillAyd The C++ Meson failure here is probably an easy fix, do you perhaps want to push a fix on this PR or rather do it in another PR?

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.

LGTM and CI looks green except for C++ Meson (other failures are unrelated).

@github-actions github-actions bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Mar 18, 2026
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