You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When casting strings to timestamps, they are converted to nanoseconds using string_to_timestamp_nanos. This results in erroneous overflow when handling quantities that can't be represented in an i64 as nanoseconds, but can be encoded as a larger timeunit.
To Reproduce
#[test]
fn test_cast_string_to_timestamp_overflow() {
// let array = TimestampSecondArray::from(vec![chrono::DateTime::MAX_UTC]);
// let array = cast(&array, &DataType::Utf8).unwrap();
let array = StringArray::from(vec!["9800-09-08T12:00:00.123456789"]);
let result = cast(&array, &DataType::Timestamp(TimeUnit::Second, None)).unwrap();
let result = result.as_primitive::<TimestampSecondType>();
assert_eq!(result.values(), &[247112596800]);
}
Expected behavior
Additional context
The text was updated successfully, but these errors were encountered:
Describe the bug
When casting strings to timestamps, they are converted to nanoseconds using
string_to_timestamp_nanos
. This results in erroneous overflow when handling quantities that can't be represented in an i64 as nanoseconds, but can be encoded as a larger timeunit.To Reproduce
Expected behavior
Additional context
The text was updated successfully, but these errors were encountered: