Skip to content

GH-51215: [C++] Migrate remaining datetime consumers to the chrono shim - #51216

Draft
rok wants to merge 3 commits into
apache:mainfrom
rok:gh-51215-chrono-shim
Draft

GH-51215: [C++] Migrate remaining datetime consumers to the chrono shim#51216
rok wants to merge 3 commits into
apache:mainfrom
rok:gh-51215-chrono-shim

Conversation

@rok

@rok rok commented Sep 7, 2026

Copy link
Copy Markdown
Member

Rationale for this change

Follow up on #48593 / #48601 - migrate remaining uses of arrow_vendored::date to arrow::internal::chrono, using std::chrono where supported.

What changes are included in this PR?

Route core calendar, parsing, formatting, and Gandiva callers through arrow::internal::chrono. Preserve backend selection and the vendored fallback, with a shared configuration header guarding the timezone implementation.

Are these changes tested?

By existing tests in CI.

Are there any user-facing changes?

Hopefully no.

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown

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

@rok
rok force-pushed the gh-51215-chrono-shim branch 2 times, most recently from 3e23a57 to d22fc96 Compare September 7, 2026 15:50
@rok

rok commented Sep 7, 2026

Copy link
Copy Markdown
Member Author

@github-actions crossbow submit verify-rc-source-windows test-build-vcpkg-win

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown

Revision: d22fc96

Submitted crossbow builds: ursacomputing/crossbow @ actions-ef7574f790

Task Status
test-build-vcpkg-win GitHub Actions
verify-rc-source-windows GitHub Actions

@rok

rok commented Sep 7, 2026

Copy link
Copy Markdown
Member Author

After #51211 is merged we can completely move to the arrow::internal::chrono shim, which will make it easier to reason about which library is being used for temporal operations and eventually move off of the vendored date.h.

@rok

rok commented Sep 7, 2026

Copy link
Copy Markdown
Member Author

@github-actions crossbow submit verify-rc-source-windows test-build-vcpkg-win

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown

Revision: ef7d5fe

Submitted crossbow builds: ursacomputing/crossbow @ actions-41c0a4fab7

Task Status
test-build-vcpkg-win GitHub Actions
verify-rc-source-windows GitHub Actions

@rok
rok force-pushed the gh-51215-chrono-shim branch from ef7d5fe to a5d7ef9 Compare September 7, 2026 18:58
@rok

rok commented Sep 7, 2026

Copy link
Copy Markdown
Member Author

@github-actions crossbow submit verify-rc-source-windows test-build-vcpkg-win

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown

Revision: a5d7ef9

Submitted crossbow builds: ursacomputing/crossbow @ actions-1c32742fcc

Task Status
test-build-vcpkg-win GitHub Actions
verify-rc-source-windows GitHub Actions

@rok
rok force-pushed the gh-51215-chrono-shim branch 3 times, most recently from b69f711 to fdcaf7e Compare September 7, 2026 22:48
@rok

rok commented Sep 7, 2026

Copy link
Copy Markdown
Member Author

@github-actions crossbow submit verify-rc-source-windows test-build-vcpkg-win

@rok

rok commented Sep 7, 2026

Copy link
Copy Markdown
Member Author

@pitrou does approach of this PR make sense? Especialy cpp/src/arrow/util/chrono_config_internal.h. If it does I'll polish it and push it to review.

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown

Revision: fdcaf7e

Submitted crossbow builds: ursacomputing/crossbow @ actions-6ed6db4ecf

Task Status
test-build-vcpkg-win GitHub Actions
verify-rc-source-windows GitHub Actions

@pitrou

pitrou commented Sep 8, 2026

Copy link
Copy Markdown
Member

@pitrou does approach of this PR make sense? Especialy cpp/src/arrow/util/chrono_config_internal.h. If it does I'll polish it and push it to review.

I think it does.

@rok
rok force-pushed the gh-51215-chrono-shim branch 2 times, most recently from ba0f5f3 to 27b9bd4 Compare September 8, 2026 15:48
Route datetime consumers in Arrow and Gandiva through
arrow::internal::chrono.

Prefer std::chrono when the standard library has reliable C++20 timezone
support, while retaining the vendored fallback and allowing an explicit
backend override. Compile the vendored timezone sources, including the Apple
helper, only when the fallback backend is selected.
@rok
rok force-pushed the gh-51215-chrono-shim branch 2 times, most recently from dd9b10c to 09d3c61 Compare September 8, 2026 16:52
@rok

rok commented Sep 8, 2026

Copy link
Copy Markdown
Member Author

@github-actions crossbow submit test-r-fedora-clang test-r-linux-as-cran test-r-alpine-linux-cran test-r-macos-as-cran r-binary-packages verify-rc-source-windows test-build-vcpkg-win

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

Revision: 09d3c61

Submitted crossbow builds: ursacomputing/crossbow @ actions-51d00219e4

Task Status
r-binary-packages GitHub Actions
test-build-vcpkg-win GitHub Actions
test-r-alpine-linux-cran GitHub Actions
test-r-fedora-clang GitHub Actions
test-r-linux-as-cran GitHub Actions
test-r-macos-as-cran GitHub Actions
verify-rc-source-windows GitHub Actions

Translate Arrow's strftime syntax to C++20 chrono replacement fields when
using the standard backend. Preserve empty formats, literals and braces,
locale-sensitive output, duration directives, timezone offsets and
abbreviations, and %E/%O modifiers.

Keep the vendored formatter available for fallback builds.
@rok

rok commented Sep 8, 2026

Copy link
Copy Markdown
Member Author

@github-actions crossbow submit test-r-fedora-clang test-r-linux-as-cran test-r-alpine-linux-cran test-r-macos-as-cran r-binary-packages verify-rc-source-windows test-build-vcpkg-win

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

Revision: 6dbcec4

Submitted crossbow builds: ursacomputing/crossbow @ actions-33aa9ce534

Task Status
r-binary-packages GitHub Actions
test-build-vcpkg-win GitHub Actions
test-r-alpine-linux-cran GitHub Actions
test-r-fedora-clang GitHub Actions
test-r-linux-as-cran GitHub Actions
test-r-macos-as-cran GitHub Actions
verify-rc-source-windows GitHub Actions

@rok

rok commented Sep 8, 2026

Copy link
Copy Markdown
Member Author

@github-actions crossbow submit test-debian-experimental-cpp-gcc-16

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

Revision: 2a05f39

Submitted crossbow builds: ursacomputing/crossbow @ actions-6604537ea7

Task Status
test-debian-experimental-cpp-gcc-16 GitHub Actions

@lriggs

lriggs commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

The gandiva changes look good.

@rok

rok commented Sep 8, 2026

Copy link
Copy Markdown
Member Author

The gandiva changes look good.

Thanks for reviewing @lriggs!

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.

3 participants