Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
518c825
Support DST timezones for ORC
Apr 2, 2026
da3d94d
Fix potential JVM crash when GetIntArrayElements fails in parse_dst_rule
Apr 17, 2026
5ba8afa
Bail out of convertOrcTimezones if parse_dst_rule threw
Apr 17, 2026
fba5b8b
Make OrcTimezoneContext.close() idempotent
Apr 17, 2026
9546721
Drop unused offset_end parameter from transition index lookup
Apr 17, 2026
7d08dc5
Remove unreachable equality branch in get_transition_index
Apr 17, 2026
53fc9b6
Explain why fillDstRuleFromTransitionRule hard-codes DOW_GE_DOM_MODE
Apr 17, 2026
15e2479
Add 2060 as a near-future DST rule verification anchor
Apr 17, 2026
f53bd7b
Document calendar mismatch at MIN_SUPPORTED_ORC_UTC_MILLIS
Apr 17, 2026
526139e
Avoid redundant ZoneId lookup in extractDstRuleFromZoneRules
Apr 17, 2026
c121a14
Document JVM tzdata dependency on OrcTimezoneInfo
Apr 17, 2026
fae3c28
Fix Copyright
Apr 17, 2026
ba0a0a7
Merge branch 'main' into orc-tz
Apr 17, 2026
0f515d3
Apply clang-format
Apr 17, 2026
7e6fad8
Merge branch 'main' into orc-tz
Apr 30, 2026
2e1b9d4
Fix comments
Apr 30, 2026
6361031
Merge branch 'main' into orc-tz
Apr 30, 2026
66305a7
Fix
Apr 30, 2026
75ff8ee
Null out ORC timezone tables after close
May 6, 2026
43c5ac2
Convert DST rule mode constants to enum
May 6, 2026
ad1b6a4
Convert DST time mode constants to enum
May 6, 2026
7557f8f
Document buildRuntimeOrcTimezoneInfo as expensive
May 6, 2026
d8427e6
Record measured cold-build cost in OrcTimezoneInfo docstring
May 6, 2026
631c765
Use cuda::std::array for DAYS_BEFORE_MONTH
May 6, 2026
5b5c09d
Add back convertOrcTimezones
May 7, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 58 additions & 4 deletions src/main/cpp/src/GpuTimeZoneDBJni.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2023-2025, NVIDIA CORPORATION.
/* Copyright (c) 2023-2026, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -97,14 +97,56 @@ Java_com_nvidia_spark_rapids_jni_GpuTimeZoneDB_convertTimestampColumnToUTCWithTz
JNI_CATCH(env, 0);
}

static spark_rapids_jni::dst_rule parse_dst_rule(JNIEnv* env, jintArray jrule)
{
spark_rapids_jni::dst_rule rule{};
if (jrule == nullptr) {
rule.has_dst = false;
return rule;
}
constexpr jsize expected_dst_rule_length = 13;
auto const rule_length = env->GetArrayLength(jrule);
JNI_ARG_CHECK(
env, rule_length == expected_dst_rule_length, "dst rule array must have 13 ints", rule);
jint* arr = env->GetIntArrayElements(jrule, nullptr);
// GetIntArrayElements returns nullptr and sets a pending OutOfMemoryError
// on failure; return early so the pending exception is raised on JNI exit.
if (arr == nullptr) { return rule; }
rule.has_dst = true;
// Order must match GpuTimeZoneDB.dstRuleToArray():
// dstSavings, startMonth, startDay, startDayOfWeek, startTime,
// startTimeMode, startMode, endMonth, endDay, endDayOfWeek,
// endTime, endTimeMode, endMode
rule.dst_savings = arr[0];
rule.start_month = arr[1];
rule.start_day = arr[2];
rule.start_dow = arr[3];
rule.start_time = arr[4];
rule.start_time_mode = arr[5];
rule.start_mode = arr[6];
rule.end_month = arr[7];
rule.end_day = arr[8];
rule.end_dow = arr[9];
rule.end_time = arr[10];
rule.end_time_mode = arr[11];
rule.end_mode = arr[12];
env->ReleaseIntArrayElements(jrule, arr, JNI_ABORT);
return rule;
}

JNIEXPORT jlong JNICALL
Java_com_nvidia_spark_rapids_jni_GpuTimeZoneDB_convertOrcTimezones(JNIEnv* env,
jclass,
jlong input_handle,
jlong base_offset_us,
jlong writer_tz_info_table,
jint writer_tz_initial_offset,
jint writer_tz_raw_offset,
jintArray writer_dst_rule,
jlong reader_tz_info_table,
jint reader_tz_raw_offset)
jint reader_tz_initial_offset,
jint reader_tz_raw_offset,
jintArray reader_dst_rule)
{
JNI_NULL_CHECK(env, input_handle, "input column is null", 0);

Expand All @@ -114,9 +156,21 @@ Java_com_nvidia_spark_rapids_jni_GpuTimeZoneDB_convertOrcTimezones(JNIEnv* env,
auto const input = reinterpret_cast<cudf::column_view const*>(input_handle);
auto const writer_tz_info_tab = reinterpret_cast<cudf::table_view const*>(writer_tz_info_table);
auto const reader_tz_info_tab = reinterpret_cast<cudf::table_view const*>(reader_tz_info_table);
auto const writer_dst = parse_dst_rule(env, writer_dst_rule);
cudf::jni::check_java_exception(env);
auto const reader_dst = parse_dst_rule(env, reader_dst_rule);
cudf::jni::check_java_exception(env);
return cudf::jni::ptr_as_jlong(
spark_rapids_jni::convert_orc_writer_reader_timezones(
*input, writer_tz_info_tab, writer_tz_raw_offset, reader_tz_info_tab, reader_tz_raw_offset)
spark_rapids_jni::convert_orc_writer_reader_timezones(*input,
static_cast<int64_t>(base_offset_us),
writer_tz_info_tab,
writer_tz_initial_offset,
writer_tz_raw_offset,
writer_dst,
reader_tz_info_tab,
reader_tz_initial_offset,
reader_tz_raw_offset,
reader_dst)
.release());
}
JNI_CATCH(env, 0);
Expand Down
Loading