Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
8400b93
Add timezone-aware parsing and ConfiguredTimeZone utilities
kosiew Oct 12, 2025
95a21ff
Handle timezone parsing in to_timestamp* UDFs
kosiew Oct 12, 2025
ac370e7
fix clippy error
kosiew Oct 12, 2025
74adc27
Merge branch 'main' into timestamp-17998
kosiew Oct 30, 2025
7bf5cb3
Add TimezoneResolver and update to_timestamp UDFs
kosiew Oct 30, 2025
09f6646
Skip resolving execution timezone with explicit offsets
kosiew Oct 30, 2025
6d54f88
Broaden has_explicit_timezone for new offset formats
kosiew Oct 30, 2025
11f0ed2
Detect trailing timezone tokens in has_explicit_timezone
kosiew Oct 30, 2025
775f11f
Generalize timezone scanning in has_explicit_timezone
kosiew Oct 30, 2025
e96a42b
Refine has_explicit_timezone logic and add tests
kosiew Oct 30, 2025
d73c571
Embed timezone in to_timestamp UDF structs
kosiew Oct 31, 2025
48ddfba
Enhance has_explicit_timezone to detect offsets with and without colo…
kosiew Oct 31, 2025
52cd505
Implement has_explicit_timezone function to detect timezone informati…
kosiew Oct 31, 2025
ea47fa6
Add documentation for local_datetime_to_timestamp handling of DST tra…
kosiew Oct 31, 2025
b741b25
Instantiated the to_timestamp UDF with the benchmark's ConfigOptions …
kosiew Nov 1, 2025
e2887e0
move tests to end of module
kosiew Nov 1, 2025
90bba02
Add deprecation notice version with version for old `new` methods in …
kosiew Nov 1, 2025
8d9c52f
Update timezone parser to return optional value
kosiew Nov 1, 2025
5bdabd3
Merge branch 'main' into timestamp-17998
kosiew Nov 1, 2025
ce3d135
Remove checks for scientific notation in timezone offset validation
kosiew Nov 6, 2025
667ada9
Add support for common timezone abbreviations and trailing offsets
kosiew Nov 6, 2025
9ea5a68
Remove dead code annotation from string_to_timestamp_nanos_formatted …
kosiew Nov 6, 2025
5ffa4dd
Merge branch 'main' into timestamp-17998
kosiew Nov 6, 2025
c666c79
Fix timezone parsing to handle None values gracefully
kosiew Nov 6, 2025
a1ba817
Update timezone handling to use Option type for clearer defaults
kosiew Nov 6, 2025
556e438
Add comprehensive tests for to_timestamp function with various timezo…
kosiew Nov 8, 2025
28d3b9b
Simplify timestamp type representation in to_timestamp timezone tests
kosiew Nov 8, 2025
9c00bf8
Improve parse_fixed_offset() with chrono support
kosiew Nov 8, 2025
f66345e
Enhance time zone parsing in parse_fixed_offset
kosiew Nov 8, 2025
764dfd3
Refactor parse_fixed_offset to improve readability of time zone forma…
kosiew Nov 8, 2025
de19df5
Clarify export_functions! macro documentation
kosiew Nov 8, 2025
d9b3d4b
Merge branch 'main' into timestamp-17998
kosiew Nov 8, 2025
b4bb002
clippy fix
kosiew Nov 8, 2025
e61918f
Optimize has_explicit_timezone for better performance
kosiew Nov 8, 2025
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
19 changes: 13 additions & 6 deletions datafusion/functions/benches/to_timestamp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,17 @@ fn criterion_benchmark(c: &mut Criterion) {
let arg_field = Field::new("a", DataType::Utf8, false).into();
let arg_fields = vec![arg_field];
let config_options = Arc::new(ConfigOptions::default());
let to_timestamp_udf = to_timestamp(config_options.as_ref());

c.bench_function("to_timestamp_no_formats_utf8", |b| {
let to_timestamp_udf = Arc::clone(&to_timestamp_udf);
let arr_data = data();
let batch_len = arr_data.len();
let string_array = ColumnarValue::Array(Arc::new(arr_data) as ArrayRef);

b.iter(|| {
black_box(
to_timestamp()
to_timestamp_udf
.invoke_with_args(ScalarFunctionArgs {
args: vec![string_array.clone()],
arg_fields: arg_fields.clone(),
Expand All @@ -137,13 +139,14 @@ fn criterion_benchmark(c: &mut Criterion) {
});

c.bench_function("to_timestamp_no_formats_largeutf8", |b| {
let to_timestamp_udf = Arc::clone(&to_timestamp_udf);
let data = cast(&data(), &DataType::LargeUtf8).unwrap();
let batch_len = data.len();
let string_array = ColumnarValue::Array(Arc::new(data) as ArrayRef);

b.iter(|| {
black_box(
to_timestamp()
to_timestamp_udf
.invoke_with_args(ScalarFunctionArgs {
args: vec![string_array.clone()],
arg_fields: arg_fields.clone(),
Expand All @@ -157,13 +160,14 @@ fn criterion_benchmark(c: &mut Criterion) {
});

c.bench_function("to_timestamp_no_formats_utf8view", |b| {
let to_timestamp_udf = Arc::clone(&to_timestamp_udf);
let data = cast(&data(), &DataType::Utf8View).unwrap();
let batch_len = data.len();
let string_array = ColumnarValue::Array(Arc::new(data) as ArrayRef);

b.iter(|| {
black_box(
to_timestamp()
to_timestamp_udf
.invoke_with_args(ScalarFunctionArgs {
args: vec![string_array.clone()],
arg_fields: arg_fields.clone(),
Expand All @@ -177,6 +181,7 @@ fn criterion_benchmark(c: &mut Criterion) {
});

c.bench_function("to_timestamp_with_formats_utf8", |b| {
let to_timestamp_udf = Arc::clone(&to_timestamp_udf);
let (inputs, format1, format2, format3) = data_with_formats();
let batch_len = inputs.len();

Expand All @@ -196,7 +201,7 @@ fn criterion_benchmark(c: &mut Criterion) {

b.iter(|| {
black_box(
to_timestamp()
to_timestamp_udf
.invoke_with_args(ScalarFunctionArgs {
args: args.clone(),
arg_fields: arg_fields.clone(),
Expand All @@ -210,6 +215,7 @@ fn criterion_benchmark(c: &mut Criterion) {
});

c.bench_function("to_timestamp_with_formats_largeutf8", |b| {
let to_timestamp_udf = Arc::clone(&to_timestamp_udf);
let (inputs, format1, format2, format3) = data_with_formats();
let batch_len = inputs.len();

Expand Down Expand Up @@ -237,7 +243,7 @@ fn criterion_benchmark(c: &mut Criterion) {

b.iter(|| {
black_box(
to_timestamp()
to_timestamp_udf
.invoke_with_args(ScalarFunctionArgs {
args: args.clone(),
arg_fields: arg_fields.clone(),
Expand All @@ -251,6 +257,7 @@ fn criterion_benchmark(c: &mut Criterion) {
});

c.bench_function("to_timestamp_with_formats_utf8view", |b| {
let to_timestamp_udf = Arc::clone(&to_timestamp_udf);
let (inputs, format1, format2, format3) = data_with_formats();

let batch_len = inputs.len();
Expand Down Expand Up @@ -279,7 +286,7 @@ fn criterion_benchmark(c: &mut Criterion) {

b.iter(|| {
black_box(
to_timestamp()
to_timestamp_udf
.invoke_with_args(ScalarFunctionArgs {
args: args.clone(),
arg_fields: arg_fields.clone(),
Expand Down
Loading