Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
2ac1a88
first draft
rok Dec 19, 2025
c68a90d
attempt to understand gcc behavior
rok Dec 23, 2025
8c7110a
keep vendored lib for gcc
rok Dec 23, 2025
38a6a9b
simplify with C++20 chrono features
rok Dec 23, 2025
deee213
Review feedback
rok Jan 5, 2026
fc5f7ec
lint
rok Jan 5, 2026
84145a7
Reference to gcc issue
rok Jan 5, 2026
2751009
Remove windows tz workarounds
rok Jan 5, 2026
65eda10
Allow gcc bug on windows
rok Jan 6, 2026
dff653e
Fix verify RC step
rok Jan 6, 2026
7bc1335
Fix R's tzdb
rok Jan 6, 2026
38b9331
Skip failing tests (due to gcc bug)
rok Jan 6, 2026
9ceb057
add mingw tzdata
rok Jan 6, 2026
02f4514
enable std::chrono for mingw
rok Jan 6, 2026
9ded81f
reenable downloading of tzdb for clang64 with mingw on windows
rok Jan 6, 2026
76b6f55
download windowsZones.xml, skip CastTimezone.ZonedTimestampToTime
rok Jan 6, 2026
f77fc2d
experiment
rok Jan 6, 2026
1e6e34e
work
rok Jan 6, 2026
c1e7dfc
experiment
rok Jan 6, 2026
8815580
another experiment
rok Jan 6, 2026
43808e8
experiment
rok Jan 7, 2026
08aca83
Reverting some changes
rok Jan 7, 2026
1729854
Reverting more changes
rok Jan 7, 2026
1def935
Review feedback
rok Jan 7, 2026
310bbc4
doctest
rok Jan 7, 2026
3374e5c
Assume gcc13+ for R
rok Jan 13, 2026
ded386e
deprecate some functions, set deprecation vesion to 24.0.0
rok Jan 13, 2026
5b0abce
skip a test
rok Jan 13, 2026
cecf3e6
skip a test
rok Jan 13, 2026
5d1118b
review feedback
rok Jan 20, 2026
33b3e4f
review feedback
rok Jan 20, 2026
9a586d0
lint
rok Jan 20, 2026
d5e760a
fix two tests and skip another
rok Jan 20, 2026
6e219c0
revert change
rok Jan 20, 2026
3721ff2
Skip windows tests in R if tzdb_path doesn't exist
rok Jan 20, 2026
edddf9a
Skip timezone tests on windows R if tzdb_path doesn't exist
rok Jan 20, 2026
8864ab8
python fix
rok Jan 20, 2026
3b09042
revert R change
rok Jan 20, 2026
4707d77
R PKGBUILD
rok Jan 20, 2026
e617005
python fix
rok Jan 20, 2026
88f8ea3
fix ARROW_USE_STD_CHRONO on windows
rok Jan 20, 2026
a575544
use wendored on clang windows
rok Jan 20, 2026
d7c8e44
cmake change and python tests
rok Jan 21, 2026
4747f2a
print if assert False
rok Jan 21, 2026
2ad69f2
add tzdb for R jobs
rok Jan 21, 2026
67f40e8
python skipif message
rok Jan 21, 2026
c469a82
skipif reason argument
rok Jan 21, 2026
63e59e6
fix python test
rok Jan 21, 2026
ba1f9c9
fix python test, tidy up
rok Jan 21, 2026
8f504a9
tidying up
rok Jan 21, 2026
c4817f8
supress deprecation warning
rok Jan 21, 2026
bdacea4
GlobalOptions initializer
rok Jan 21, 2026
f5195fa
GlobalOptions
rok Jan 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,13 @@ jobs:
export CMAKE_BUILD_PARALLEL_LEVEL=$NUMBER_OF_PROCESSORS
ci/scripts/cpp_build.sh "$(pwd)" "$(pwd)/build"
- name: Download Timezone Database
if: matrix.msystem_upper == 'CLANG64'
shell: bash
run: ci/scripts/download_tz_database.sh
run: |
# TODO(GH-48593): msys2 clang64 uses libc++ and vendored date.h library
# which needs tzdata database to build Arrow with time zone support.
# https://github.com/apache/arrow/issues/48593
ci/scripts/download_tz_database.sh
- name: Download MinIO
shell: msys2 {0}
run: |
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/cpp_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,6 @@ jobs:
with:
fetch-depth: 0
submodules: recursive
- name: Download Timezone Database
shell: bash
run: ci/scripts/download_tz_database.sh
- name: Install msys2 (for tzdata for ORC tests)
uses: msys2/setup-msys2@v2
id: setup-msys2
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/matlab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,6 @@ jobs:
uses: matlab-actions/setup-matlab@v2
with:
release: R2025b
- name: Download Timezone Database
shell: bash
run: ci/scripts/download_tz_database.sh
- name: Install ccache
shell: bash
run: ci/scripts/install_ccache.sh 4.6.3 /usr
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/r.yml
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,12 @@ jobs:
mkdir -p "$HOME/.local/bin"
ci/scripts/install_minio.sh latest "$HOME/.local"
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Download Timezone Database
shell: bash
run: |
# RTools 40's MinGW GCC may not support C++20 chrono timezones,
# so Arrow uses the vendored date library which requires tzdata
ci/scripts/download_tz_database.sh
- run: mkdir r/windows
- name: Download artifacts
uses: actions/download-artifact@v7
Expand Down
2 changes: 0 additions & 2 deletions cpp/src/arrow/compute/function_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,9 @@ TEST(FunctionOptions, Equality) {
options.emplace_back(new StrptimeOptions("%Y", TimeUnit::type::MILLI, true));
options.emplace_back(new StrptimeOptions("%Y", TimeUnit::type::NANO));
options.emplace_back(new StrftimeOptions("%Y-%m-%dT%H:%M:%SZ", "C"));
#ifndef _WIN32
options.emplace_back(new AssumeTimezoneOptions(
"Europe/Amsterdam", AssumeTimezoneOptions::Ambiguous::AMBIGUOUS_RAISE,
AssumeTimezoneOptions::Nonexistent::NONEXISTENT_RAISE));
#endif
options.emplace_back(new PadOptions(5, " "));
options.emplace_back(new PadOptions(10, "A"));
options.emplace_back(new PadOptions(10, "A", false));
Expand Down
15 changes: 6 additions & 9 deletions cpp/src/arrow/compute/kernels/scalar_cast_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2358,15 +2358,7 @@ constexpr char kTimestampSecondsJson[] =
constexpr char kTimestampExtremeJson[] =
R"(["1677-09-20T00:00:59.123456", "2262-04-13T23:23:23.999999"])";

class CastTimezone : public ::testing::Test {
protected:
void SetUp() override {
#ifdef _WIN32
// Initialize timezone database on Windows
ASSERT_OK(InitTestTimezoneDatabase());
#endif
}
};
class CastTimezone : public ::testing::Test {};

TEST(Cast, TimestampToDate) {
// See scalar_temporal_test.cc
Expand Down Expand Up @@ -2595,6 +2587,11 @@ TEST(Cast, TimestampToTime) {
}

TEST_F(CastTimezone, ZonedTimestampToTime) {
// TODO(GH-48743): GCC libstdc++ has a bug with DST transitions
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116110
#if defined(_WIN32) && defined(__GNUC__) && !defined(__clang__)
GTEST_SKIP() << "Test triggers GCC libstdc++ bug (GH-48743).";
#endif
CheckCast(ArrayFromJSON(timestamp(TimeUnit::NANO, "Pacific/Marquesas"), kTimestampJson),
ArrayFromJSON(time64(TimeUnit::NANO), R"([
52259123456789, 50003999999999, 56480001001001, 65000000000000,
Expand Down
43 changes: 22 additions & 21 deletions cpp/src/arrow/compute/kernels/scalar_temporal_binary.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include "arrow/util/checked_cast.h"
#include "arrow/util/logging_internal.h"
#include "arrow/util/time.h"
#include "arrow/vendored/datetime.h"

namespace arrow {

Expand All @@ -37,28 +36,30 @@ using internal::checked_pointer_cast;
namespace compute {
namespace internal {

namespace chrono = arrow::internal::chrono;

namespace {

using arrow_vendored::date::days;
using arrow_vendored::date::floor;
using arrow_vendored::date::hh_mm_ss;
using arrow_vendored::date::local_days;
using arrow_vendored::date::local_time;
using arrow_vendored::date::sys_days;
using arrow_vendored::date::sys_time;
using arrow_vendored::date::trunc;
using arrow_vendored::date::weekday;
using arrow_vendored::date::weeks;
using arrow_vendored::date::year_month_day;
using arrow_vendored::date::year_month_weekday;
using arrow_vendored::date::years;
using arrow_vendored::date::literals::dec;
using arrow_vendored::date::literals::jan;
using arrow_vendored::date::literals::last;
using arrow_vendored::date::literals::mon;
using arrow_vendored::date::literals::sun;
using arrow_vendored::date::literals::thu;
using arrow_vendored::date::literals::wed;
using chrono::days;
using chrono::dec;
using chrono::floor;
using chrono::hh_mm_ss;
using chrono::jan;
using chrono::last;
using chrono::local_days;
using chrono::local_time;
using chrono::mon;
using chrono::sun;
using chrono::sys_days;
using chrono::sys_time;
using chrono::thu;
using chrono::trunc;
using chrono::wed;
using chrono::weekday;
using chrono::weeks;
using chrono::year_month_day;
using chrono::year_month_weekday;
using chrono::years;
using internal::applicator::ScalarBinaryNotNullStatefulEqualTypes;

using DayOfWeekState = OptionsWrapper<DayOfWeekOptions>;
Expand Down
34 changes: 26 additions & 8 deletions cpp/src/arrow/compute/kernels/scalar_temporal_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "arrow/type_fwd.h"
#include "arrow/type_traits.h"
#include "arrow/util/checked_cast.h"
#include "arrow/util/chrono_internal.h" // for ARROW_USE_STD_CHRONO
#include "arrow/util/formatting.h"
#include "arrow/util/logging_internal.h"

Expand Down Expand Up @@ -411,14 +412,6 @@ class ScalarTemporalTest : public ::testing::Test {
RoundTemporalOptions round_to_15_quarters =
RoundTemporalOptions(15, CalendarUnit::QUARTER);
RoundTemporalOptions round_to_15_years = RoundTemporalOptions(15, CalendarUnit::YEAR);

protected:
void SetUp() override {
#ifdef _WIN32
// Initialize timezone database on Windows
ASSERT_OK(InitTestTimezoneDatabase());
#endif
}
};

class ScalarTemporalTestStrictCeil : public ScalarTemporalTest {
Expand Down Expand Up @@ -716,6 +709,11 @@ TEST_F(ScalarTemporalTest, TestIsLeapYear) {
}

TEST_F(ScalarTemporalTest, TestZoned1) {
// TODO(GH-48743): GCC libstdc++ has a bug with DST transitions
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116110
#if defined(_WIN32) && defined(__GNUC__) && !defined(__clang__)
GTEST_SKIP() << "Test triggers GCC libstdc++ bug (GH-48743).";
#endif
std::vector<std::string> timezones = {"Pacific/Marquesas", "-09:30"};
for (const auto& timezone : timezones) {
auto unit = timestamp(TimeUnit::NANO, timezone);
Expand Down Expand Up @@ -814,6 +812,11 @@ TEST_F(ScalarTemporalTest, TestZoned1) {
}

TEST_F(ScalarTemporalTest, TestZoned2) {
// TODO(GH-48743): GCC libstdc++ has a bug with DST transitions
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116110
#if defined(_WIN32) && defined(__GNUC__) && !defined(__clang__)
GTEST_SKIP() << "Test triggers GCC libstdc++ bug (GH-48743).";
#endif
for (auto u : TimeUnit::values()) {
auto unit = timestamp(u, "Australia/Broken_Hill");
auto month = "[1, 3, 1, 5, 1, 12, 12, 12, 1, 1, 1, 1, 12, 12, 12, 1, null]";
Expand Down Expand Up @@ -2775,6 +2778,11 @@ TEST_F(ScalarTemporalTestMultipleSinceGreaterUnit, CeilUTC) {
}

TEST_F(ScalarTemporalTestMultipleSinceGreaterUnit, CeilZoned) {
// TODO(GH-48743): GCC libstdc++ has a bug with DST transitions
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116110
#if defined(_WIN32) && defined(__GNUC__) && !defined(__clang__)
GTEST_SKIP() << "Test triggers GCC libstdc++ bug (GH-48743).";
#endif
std::string op = "ceil_temporal";

// Data for tests below was generated via lubridate with the exception
Expand Down Expand Up @@ -3165,6 +3173,11 @@ TEST_F(ScalarTemporalTestMultipleSinceGreaterUnit, FloorUTC) {
}

TEST_F(ScalarTemporalTestMultipleSinceGreaterUnit, FloorZoned) {
// TODO(GH-48743): GCC libstdc++ has a bug with DST transitions
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116110
#if defined(_WIN32) && defined(__GNUC__) && !defined(__clang__)
GTEST_SKIP() << "Test triggers GCC libstdc++ bug (GH-48743).";
#endif
std::string op = "floor_temporal";

// Data for tests below was generated via lubridate with the exception
Expand Down Expand Up @@ -3598,6 +3611,11 @@ TEST_F(ScalarTemporalTestMultipleSinceGreaterUnit, RoundUTC) {
}

TEST_F(ScalarTemporalTestMultipleSinceGreaterUnit, RoundZoned) {
// TODO(GH-48743): GCC libstdc++ has a bug with DST transitions
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116110
#if defined(_WIN32) && defined(__GNUC__) && !defined(__clang__)
GTEST_SKIP() << "Test triggers GCC libstdc++ bug (GH-48743).";
#endif
std::string op = "round_temporal";

// Data for tests below was generated via lubridate with the exception
Expand Down
74 changes: 36 additions & 38 deletions cpp/src/arrow/compute/kernels/scalar_temporal_unary.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include "arrow/util/logging_internal.h"
#include "arrow/util/time.h"
#include "arrow/util/value_parsing.h"
#include "arrow/vendored/datetime.h"

namespace arrow {

Expand All @@ -38,34 +37,36 @@ using internal::checked_pointer_cast;

namespace compute::internal {

namespace chrono = arrow::internal::chrono;

namespace {

using arrow_vendored::date::ceil;
using arrow_vendored::date::days;
using arrow_vendored::date::floor;
using arrow_vendored::date::hh_mm_ss;
using arrow_vendored::date::local_days;
using arrow_vendored::date::local_time;
using arrow_vendored::date::locate_zone;
using arrow_vendored::date::Monday;
using arrow_vendored::date::months;
using arrow_vendored::date::round;
using arrow_vendored::date::Sunday;
using arrow_vendored::date::sys_time;
using arrow_vendored::date::trunc;
using arrow_vendored::date::weekday;
using arrow_vendored::date::weeks;
using arrow_vendored::date::year;
using arrow_vendored::date::year_month_day;
using arrow_vendored::date::year_month_weekday;
using arrow_vendored::date::years;
using arrow_vendored::date::literals::dec;
using arrow_vendored::date::literals::jan;
using arrow_vendored::date::literals::last;
using arrow_vendored::date::literals::mon;
using arrow_vendored::date::literals::sun;
using arrow_vendored::date::literals::thu;
using arrow_vendored::date::literals::wed;
using chrono::ceil;
using chrono::days;
using chrono::dec;
using chrono::floor;
using chrono::hh_mm_ss;
using chrono::jan;
using chrono::last;
using chrono::local_days;
using chrono::local_time;
using chrono::locate_zone;
using chrono::mon;
using chrono::Monday;
using chrono::months;
using chrono::round;
using chrono::sun;
using chrono::Sunday;
using chrono::sys_time;
using chrono::thu;
using chrono::trunc;
using chrono::wed;
using chrono::weekday;
using chrono::weeks;
using chrono::year;
using chrono::year_month_day;
using chrono::year_month_weekday;
using chrono::years;
using std::chrono::duration_cast;
using std::chrono::hours;
using std::chrono::minutes;
Expand Down Expand Up @@ -525,8 +526,8 @@ struct Week {
}

Localizer localizer_;
arrow_vendored::date::weekday wd_;
arrow_vendored::date::days days_offset_;
chrono::weekday wd_;
chrono::days days_offset_;
const bool count_from_zero_;
const bool first_week_is_fully_in_year_;
};
Expand Down Expand Up @@ -1379,35 +1380,32 @@ struct AssumeTimezone {
T Call(KernelContext*, Arg0 arg, Status* st) const {
try {
return get_local_time<T, Arg0>(arg, &tz_);
} catch (const arrow_vendored::date::nonexistent_local_time& e) {
} catch (const chrono::nonexistent_local_time& e) {
switch (options.nonexistent) {
case AssumeTimezoneOptions::Nonexistent::NONEXISTENT_RAISE: {
*st = Status::Invalid("Timestamp doesn't exist in timezone '", options.timezone,
"': ", e.what());
return arg;
}
case AssumeTimezoneOptions::Nonexistent::NONEXISTENT_EARLIEST: {
return get_local_time<T, Arg0>(arg, arrow_vendored::date::choose::latest,
&tz_) -
1;
return get_local_time<T, Arg0>(arg, chrono::choose::latest, &tz_) - 1;
}
case AssumeTimezoneOptions::Nonexistent::NONEXISTENT_LATEST: {
return get_local_time<T, Arg0>(arg, arrow_vendored::date::choose::latest, &tz_);
return get_local_time<T, Arg0>(arg, chrono::choose::latest, &tz_);
}
}
} catch (const arrow_vendored::date::ambiguous_local_time& e) {
} catch (const chrono::ambiguous_local_time& e) {
switch (options.ambiguous) {
case AssumeTimezoneOptions::Ambiguous::AMBIGUOUS_RAISE: {
*st = Status::Invalid("Timestamp is ambiguous in timezone '", options.timezone,
"': ", e.what());
return arg;
}
case AssumeTimezoneOptions::Ambiguous::AMBIGUOUS_EARLIEST: {
return get_local_time<T, Arg0>(arg, arrow_vendored::date::choose::earliest,
&tz_);
return get_local_time<T, Arg0>(arg, chrono::choose::earliest, &tz_);
}
case AssumeTimezoneOptions::Ambiguous::AMBIGUOUS_LATEST: {
return get_local_time<T, Arg0>(arg, arrow_vendored::date::choose::latest, &tz_);
return get_local_time<T, Arg0>(arg, chrono::choose::latest, &tz_);
}
}
}
Expand Down
Loading
Loading