tustvold opened a new issue, #4033:
URL: https://github.com/apache/arrow-rs/issues/4033
**Describe the bug**
<!--
A clear and concise description of what the bug is.
-->
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**
<!--
Steps to reproduce the behavior:
-->
```
#[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**
<!--
A clear and concise description of what you expected to happen.
-->
**Additional context**
<!--
Add any other context about the problem here.
-->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]