Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 numberDiff line numberDiff 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
Comment thread
rok marked this conversation as resolved.
- name: Download MinIO
shell: msys2 {0}
run: |
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/cpp_windows.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -86,9 +86,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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 uses GCC 8.x which does 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: 1 addition & 1 deletion ci/conda_env_gandiva_win.txt
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,6 +15,6 @@
# specific language governing permissions and limitations
# under the License.

# ARROW-17830 Temporarily pin LLVM version on Appveyor due to a bug in Conda's packaging of LLVM 15.
# ARROW-17830 Temporarily pin LLVM version on Windows due to a bug in Conda's packaging of LLVM 15.
clangdev<15
llvmdev<15
1 change: 0 additions & 1 deletion ci/scripts/PKGBUILD
Original file line numberDiff line numberDiff line change
Expand Up@@ -50,7 +50,6 @@ source_dir="$ARROW_HOME"
# Append `#commit=54b1b2f688e5e84b4c664b1e12a95f93b94ab2f3` to the URL to select a revision
# source=("${source_dir}"::"git+https://github.com/apache/arrow")
# sha256sums=("SKIP")
# source_dir="${APPVEYOR_BUILD_FOLDER}/${source_dir}"

cpp_build_dir=build-${CARCH}-cpp

Expand Down
2 changes: 1 addition & 1 deletion ci/scripts/download_tz_database.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,7 +20,7 @@
set -ex

# Download database
curl https://data.iana.org/time-zones/releases/tzdata2024b.tar.gz --output ~/Downloads/tzdata.tar.gz
curl https://data.iana.org/time-zones/tzdata-latest.tar.gz --output ~/Downloads/tzdata.tar.gz

@rokrokFeb 10, 2026

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Changing here and elsewhere to latest.


# Extract
mkdir -p ~/Downloads/tzdata
Expand Down
2 changes: 0 additions & 2 deletions cpp/src/arrow/compute/function_test.cc
Original file line numberDiff line numberDiff 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 numberDiff line numberDiff 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 DownExpand 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 numberDiff line numberDiff 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
33 changes: 25 additions & 8 deletions cpp/src/arrow/compute/kernels/scalar_temporal_test.cc
Original file line numberDiff line numberDiff line change
Expand Up@@ -411,14 +411,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 DownExpand Up@@ -716,6 +708,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 DownExpand Up@@ -814,6 +811,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 DownExpand Up@@ -2775,6 +2777,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 DownExpand Up@@ -3165,6 +3172,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 DownExpand Up@@ -3598,6 +3610,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 numberDiff line numberDiff 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 DownExpand 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 DownExpand 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
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all \u003cpre\u003e\u003ccode\u003e blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks"); } } catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); } })(); (function(){ try { var __m = "github.com"; var __re = new RegExp('^' + "github\\.com" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 numberDiff line numberDiff 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
Comment thread
rok marked this conversation as resolved.
- name: Download MinIO
shell: msys2 {0}
run: |
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/cpp_windows.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -86,9 +86,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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 uses GCC 8.x which does 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: 1 addition & 1 deletion ci/conda_env_gandiva_win.txt
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,6 +15,6 @@
# specific language governing permissions and limitations
# under the License.

# ARROW-17830 Temporarily pin LLVM version on Appveyor due to a bug in Conda's packaging of LLVM 15.
# ARROW-17830 Temporarily pin LLVM version on Windows due to a bug in Conda's packaging of LLVM 15.
clangdev<15
llvmdev<15
1 change: 0 additions & 1 deletion ci/scripts/PKGBUILD
Original file line numberDiff line numberDiff line change
Expand Up@@ -50,7 +50,6 @@ source_dir="$ARROW_HOME"
# Append `#commit=54b1b2f688e5e84b4c664b1e12a95f93b94ab2f3` to the URL to select a revision
# source=("${source_dir}"::"git+https://github.com/apache/arrow")
# sha256sums=("SKIP")
# source_dir="${APPVEYOR_BUILD_FOLDER}/${source_dir}"

cpp_build_dir=build-${CARCH}-cpp

Expand Down
2 changes: 1 addition & 1 deletion ci/scripts/download_tz_database.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,7 +20,7 @@
set -ex

# Download database
curl https://data.iana.org/time-zones/releases/tzdata2024b.tar.gz --output ~/Downloads/tzdata.tar.gz
curl https://data.iana.org/time-zones/tzdata-latest.tar.gz --output ~/Downloads/tzdata.tar.gz

@rokrokFeb 10, 2026

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Changing here and elsewhere to latest.


# Extract
mkdir -p ~/Downloads/tzdata
Expand Down
2 changes: 0 additions & 2 deletions cpp/src/arrow/compute/function_test.cc
Original file line numberDiff line numberDiff 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 numberDiff line numberDiff 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 DownExpand 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 numberDiff line numberDiff 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
33 changes: 25 additions & 8 deletions cpp/src/arrow/compute/kernels/scalar_temporal_test.cc
Original file line numberDiff line numberDiff line change
Expand Up@@ -411,14 +411,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 DownExpand Up@@ -716,6 +708,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 DownExpand Up@@ -814,6 +811,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 DownExpand Up@@ -2775,6 +2777,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 DownExpand Up@@ -3165,6 +3172,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 DownExpand Up@@ -3598,6 +3610,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 numberDiff line numberDiff 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 DownExpand 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 DownExpand 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
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 numberDiff line numberDiff 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
Comment thread
rok marked this conversation as resolved.
- name: Download MinIO
shell: msys2 {0}
run: |
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/cpp_windows.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -86,9 +86,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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 uses GCC 8.x which does 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: 1 addition & 1 deletion ci/conda_env_gandiva_win.txt
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,6 +15,6 @@
# specific language governing permissions and limitations
# under the License.

# ARROW-17830 Temporarily pin LLVM version on Appveyor due to a bug in Conda's packaging of LLVM 15.
# ARROW-17830 Temporarily pin LLVM version on Windows due to a bug in Conda's packaging of LLVM 15.
clangdev<15
llvmdev<15
1 change: 0 additions & 1 deletion ci/scripts/PKGBUILD
Original file line numberDiff line numberDiff line change
Expand Up@@ -50,7 +50,6 @@ source_dir="$ARROW_HOME"
# Append `#commit=54b1b2f688e5e84b4c664b1e12a95f93b94ab2f3` to the URL to select a revision
# source=("${source_dir}"::"git+https://github.com/apache/arrow")
# sha256sums=("SKIP")
# source_dir="${APPVEYOR_BUILD_FOLDER}/${source_dir}"

cpp_build_dir=build-${CARCH}-cpp

Expand Down
2 changes: 1 addition & 1 deletion ci/scripts/download_tz_database.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,7 +20,7 @@
set -ex

# Download database
curl https://data.iana.org/time-zones/releases/tzdata2024b.tar.gz --output ~/Downloads/tzdata.tar.gz
curl https://data.iana.org/time-zones/tzdata-latest.tar.gz --output ~/Downloads/tzdata.tar.gz

@rokrokFeb 10, 2026

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Changing here and elsewhere to latest.


# Extract
mkdir -p ~/Downloads/tzdata
Expand Down
2 changes: 0 additions & 2 deletions cpp/src/arrow/compute/function_test.cc
Original file line numberDiff line numberDiff 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 numberDiff line numberDiff 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 DownExpand 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 numberDiff line numberDiff 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
33 changes: 25 additions & 8 deletions cpp/src/arrow/compute/kernels/scalar_temporal_test.cc
Original file line numberDiff line numberDiff line change
Expand Up@@ -411,14 +411,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 DownExpand Up@@ -716,6 +708,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 DownExpand Up@@ -814,6 +811,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 DownExpand Up@@ -2775,6 +2777,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 DownExpand Up@@ -3165,6 +3172,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 DownExpand Up@@ -3598,6 +3610,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 numberDiff line numberDiff 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 DownExpand 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 DownExpand 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
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length \u003e 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 numberDiff line numberDiff 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
Comment thread
rok marked this conversation as resolved.
- name: Download MinIO
shell: msys2 {0}
run: |
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/cpp_windows.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -86,9 +86,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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 uses GCC 8.x which does 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: 1 addition & 1 deletion ci/conda_env_gandiva_win.txt
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,6 +15,6 @@
# specific language governing permissions and limitations
# under the License.

# ARROW-17830 Temporarily pin LLVM version on Appveyor due to a bug in Conda's packaging of LLVM 15.
# ARROW-17830 Temporarily pin LLVM version on Windows due to a bug in Conda's packaging of LLVM 15.
clangdev<15
llvmdev<15
1 change: 0 additions & 1 deletion ci/scripts/PKGBUILD
Original file line numberDiff line numberDiff line change
Expand Up@@ -50,7 +50,6 @@ source_dir="$ARROW_HOME"
# Append `#commit=54b1b2f688e5e84b4c664b1e12a95f93b94ab2f3` to the URL to select a revision
# source=("${source_dir}"::"git+https://github.com/apache/arrow")
# sha256sums=("SKIP")
# source_dir="${APPVEYOR_BUILD_FOLDER}/${source_dir}"

cpp_build_dir=build-${CARCH}-cpp

Expand Down
2 changes: 1 addition & 1 deletion ci/scripts/download_tz_database.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,7 +20,7 @@
set -ex

# Download database
curl https://data.iana.org/time-zones/releases/tzdata2024b.tar.gz --output ~/Downloads/tzdata.tar.gz
curl https://data.iana.org/time-zones/tzdata-latest.tar.gz --output ~/Downloads/tzdata.tar.gz

@rokrokFeb 10, 2026

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Changing here and elsewhere to latest.


# Extract
mkdir -p ~/Downloads/tzdata
Expand Down
2 changes: 0 additions & 2 deletions cpp/src/arrow/compute/function_test.cc
Original file line numberDiff line numberDiff 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 numberDiff line numberDiff 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 DownExpand 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 numberDiff line numberDiff 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
33 changes: 25 additions & 8 deletions cpp/src/arrow/compute/kernels/scalar_temporal_test.cc
Original file line numberDiff line numberDiff line change
Expand Up@@ -411,14 +411,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 DownExpand Up@@ -716,6 +708,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 DownExpand Up@@ -814,6 +811,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 DownExpand Up@@ -2775,6 +2777,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 DownExpand Up@@ -3165,6 +3172,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 DownExpand Up@@ -3598,6 +3610,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 numberDiff line numberDiff 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 DownExpand 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 DownExpand 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
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 numberDiff line numberDiff 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
Comment thread
rok marked this conversation as resolved.
- name: Download MinIO
shell: msys2 {0}
run: |
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/cpp_windows.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -86,9 +86,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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 uses GCC 8.x which does 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: 1 addition & 1 deletion ci/conda_env_gandiva_win.txt
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,6 +15,6 @@
# specific language governing permissions and limitations
# under the License.

# ARROW-17830 Temporarily pin LLVM version on Appveyor due to a bug in Conda's packaging of LLVM 15.
# ARROW-17830 Temporarily pin LLVM version on Windows due to a bug in Conda's packaging of LLVM 15.
clangdev<15
llvmdev<15
1 change: 0 additions & 1 deletion ci/scripts/PKGBUILD
Original file line numberDiff line numberDiff line change
Expand Up@@ -50,7 +50,6 @@ source_dir="$ARROW_HOME"
# Append `#commit=54b1b2f688e5e84b4c664b1e12a95f93b94ab2f3` to the URL to select a revision
# source=("${source_dir}"::"git+https://github.com/apache/arrow")
# sha256sums=("SKIP")
# source_dir="${APPVEYOR_BUILD_FOLDER}/${source_dir}"

cpp_build_dir=build-${CARCH}-cpp

Expand Down
2 changes: 1 addition & 1 deletion ci/scripts/download_tz_database.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,7 +20,7 @@
set -ex

# Download database
curl https://data.iana.org/time-zones/releases/tzdata2024b.tar.gz --output ~/Downloads/tzdata.tar.gz
curl https://data.iana.org/time-zones/tzdata-latest.tar.gz --output ~/Downloads/tzdata.tar.gz

@rokrokFeb 10, 2026

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Changing here and elsewhere to latest.


# Extract
mkdir -p ~/Downloads/tzdata
Expand Down
2 changes: 0 additions & 2 deletions cpp/src/arrow/compute/function_test.cc
Original file line numberDiff line numberDiff 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 numberDiff line numberDiff 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 DownExpand 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 numberDiff line numberDiff 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
33 changes: 25 additions & 8 deletions cpp/src/arrow/compute/kernels/scalar_temporal_test.cc
Original file line numberDiff line numberDiff line change
Expand Up@@ -411,14 +411,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 DownExpand Up@@ -716,6 +708,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 DownExpand Up@@ -814,6 +811,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 DownExpand Up@@ -2775,6 +2777,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 DownExpand Up@@ -3165,6 +3172,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 DownExpand Up@@ -3598,6 +3610,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 numberDiff line numberDiff 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 DownExpand 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 DownExpand 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
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 numberDiff line numberDiff 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
Comment thread
rok marked this conversation as resolved.
- name: Download MinIO
shell: msys2 {0}
run: |
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/cpp_windows.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -86,9 +86,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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 uses GCC 8.x which does 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: 1 addition & 1 deletion ci/conda_env_gandiva_win.txt
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,6 +15,6 @@
# specific language governing permissions and limitations
# under the License.

# ARROW-17830 Temporarily pin LLVM version on Appveyor due to a bug in Conda's packaging of LLVM 15.
# ARROW-17830 Temporarily pin LLVM version on Windows due to a bug in Conda's packaging of LLVM 15.
clangdev<15
llvmdev<15
1 change: 0 additions & 1 deletion ci/scripts/PKGBUILD
Original file line numberDiff line numberDiff line change
Expand Up@@ -50,7 +50,6 @@ source_dir="$ARROW_HOME"
# Append `#commit=54b1b2f688e5e84b4c664b1e12a95f93b94ab2f3` to the URL to select a revision
# source=("${source_dir}"::"git+https://github.com/apache/arrow")
# sha256sums=("SKIP")
# source_dir="${APPVEYOR_BUILD_FOLDER}/${source_dir}"

cpp_build_dir=build-${CARCH}-cpp

Expand Down
2 changes: 1 addition & 1 deletion ci/scripts/download_tz_database.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,7 +20,7 @@
set -ex

# Download database
curl https://data.iana.org/time-zones/releases/tzdata2024b.tar.gz --output ~/Downloads/tzdata.tar.gz
curl https://data.iana.org/time-zones/tzdata-latest.tar.gz --output ~/Downloads/tzdata.tar.gz

@rokrokFeb 10, 2026

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Changing here and elsewhere to latest.


# Extract
mkdir -p ~/Downloads/tzdata
Expand Down
2 changes: 0 additions & 2 deletions cpp/src/arrow/compute/function_test.cc
Original file line numberDiff line numberDiff 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 numberDiff line numberDiff 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 DownExpand 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 numberDiff line numberDiff 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
33 changes: 25 additions & 8 deletions cpp/src/arrow/compute/kernels/scalar_temporal_test.cc
Original file line numberDiff line numberDiff line change
Expand Up@@ -411,14 +411,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 DownExpand Up@@ -716,6 +708,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 DownExpand Up@@ -814,6 +811,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 DownExpand Up@@ -2775,6 +2777,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 DownExpand Up@@ -3165,6 +3172,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 DownExpand Up@@ -3598,6 +3610,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 numberDiff line numberDiff 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 DownExpand 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 DownExpand 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
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 numberDiff line numberDiff 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
Comment thread
rok marked this conversation as resolved.
- name: Download MinIO
shell: msys2 {0}
run: |
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/cpp_windows.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -86,9 +86,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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 uses GCC 8.x which does 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: 1 addition & 1 deletion ci/conda_env_gandiva_win.txt
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,6 +15,6 @@
# specific language governing permissions and limitations
# under the License.

# ARROW-17830 Temporarily pin LLVM version on Appveyor due to a bug in Conda's packaging of LLVM 15.
# ARROW-17830 Temporarily pin LLVM version on Windows due to a bug in Conda's packaging of LLVM 15.
clangdev<15
llvmdev<15
1 change: 0 additions & 1 deletion ci/scripts/PKGBUILD
Original file line numberDiff line numberDiff line change
Expand Up@@ -50,7 +50,6 @@ source_dir="$ARROW_HOME"
# Append `#commit=54b1b2f688e5e84b4c664b1e12a95f93b94ab2f3` to the URL to select a revision
# source=("${source_dir}"::"git+https://github.com/apache/arrow")
# sha256sums=("SKIP")
# source_dir="${APPVEYOR_BUILD_FOLDER}/${source_dir}"

cpp_build_dir=build-${CARCH}-cpp

Expand Down
2 changes: 1 addition & 1 deletion ci/scripts/download_tz_database.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,7 +20,7 @@
set -ex

# Download database
curl https://data.iana.org/time-zones/releases/tzdata2024b.tar.gz --output ~/Downloads/tzdata.tar.gz
curl https://data.iana.org/time-zones/tzdata-latest.tar.gz --output ~/Downloads/tzdata.tar.gz

@rokrokFeb 10, 2026

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Changing here and elsewhere to latest.


# Extract
mkdir -p ~/Downloads/tzdata
Expand Down
2 changes: 0 additions & 2 deletions cpp/src/arrow/compute/function_test.cc
Original file line numberDiff line numberDiff 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 numberDiff line numberDiff 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 DownExpand 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 numberDiff line numberDiff 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
33 changes: 25 additions & 8 deletions cpp/src/arrow/compute/kernels/scalar_temporal_test.cc
Original file line numberDiff line numberDiff line change
Expand Up@@ -411,14 +411,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 DownExpand Up@@ -716,6 +708,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 DownExpand Up@@ -814,6 +811,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 DownExpand Up@@ -2775,6 +2777,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 DownExpand Up@@ -3165,6 +3172,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 DownExpand Up@@ -3598,6 +3610,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 numberDiff line numberDiff 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 DownExpand 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 DownExpand 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
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 numberDiff line numberDiff 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
Comment thread
rok marked this conversation as resolved.
- name: Download MinIO
shell: msys2 {0}
run: |
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/cpp_windows.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -86,9 +86,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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 uses GCC 8.x which does 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: 1 addition & 1 deletion ci/conda_env_gandiva_win.txt
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,6 +15,6 @@
# specific language governing permissions and limitations
# under the License.

# ARROW-17830 Temporarily pin LLVM version on Appveyor due to a bug in Conda's packaging of LLVM 15.
# ARROW-17830 Temporarily pin LLVM version on Windows due to a bug in Conda's packaging of LLVM 15.
clangdev<15
llvmdev<15
1 change: 0 additions & 1 deletion ci/scripts/PKGBUILD
Original file line numberDiff line numberDiff line change
Expand Up@@ -50,7 +50,6 @@ source_dir="$ARROW_HOME"
# Append `#commit=54b1b2f688e5e84b4c664b1e12a95f93b94ab2f3` to the URL to select a revision
# source=("${source_dir}"::"git+https://github.com/apache/arrow")
# sha256sums=("SKIP")
# source_dir="${APPVEYOR_BUILD_FOLDER}/${source_dir}"

cpp_build_dir=build-${CARCH}-cpp

Expand Down
2 changes: 1 addition & 1 deletion ci/scripts/download_tz_database.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,7 +20,7 @@
set -ex

# Download database
curl https://data.iana.org/time-zones/releases/tzdata2024b.tar.gz --output ~/Downloads/tzdata.tar.gz
curl https://data.iana.org/time-zones/tzdata-latest.tar.gz --output ~/Downloads/tzdata.tar.gz

@rokrokFeb 10, 2026

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Changing here and elsewhere to latest.


# Extract
mkdir -p ~/Downloads/tzdata
Expand Down
2 changes: 0 additions & 2 deletions cpp/src/arrow/compute/function_test.cc
Original file line numberDiff line numberDiff 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 numberDiff line numberDiff 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 DownExpand 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 numberDiff line numberDiff 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
33 changes: 25 additions & 8 deletions cpp/src/arrow/compute/kernels/scalar_temporal_test.cc
Original file line numberDiff line numberDiff line change
Expand Up@@ -411,14 +411,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 DownExpand Up@@ -716,6 +708,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 DownExpand Up@@ -814,6 +811,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 DownExpand Up@@ -2775,6 +2777,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 DownExpand Up@@ -3165,6 +3172,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 DownExpand Up@@ -3598,6 +3610,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 numberDiff line numberDiff 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 DownExpand 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 DownExpand 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