alamb opened a new issue #587:
URL: https://github.com/apache/arrow-rs/issues/587
**Is your feature request related to a problem or challenge? Please describe
what you are trying to do.**
I am trying to work with timestamps -- specifically converting data from
csv, etc to timestamps
**Describe the solution you'd like**
I would like the `cast` kernel to support converting `StringArray` to
`TimestampNanosecondArray` (and the other date / time / timestamp related types)
I would like the following Rust code to compile and produce a String array
with value `"1970-01-01 00:00:00.000000100"`:
Reproducer:
```rust
let array = TimestampNanosecondArray::from(vec![100]);
let array: ArrayRef = Arc::new(array);
// array[0]: "1970-01-01 00:00:00.000000100"
println!("array[0]: {:?}", array_value_to_string(&array, 0).unwrap());
// cast to string array results in an error:
// thread 'main' panicked at 'called `Result::unwrap()` on an `Err`
value: CastError("Casting from Timestamp(Nanosecond, None) to Utf8 not
supported")', src/main.rs:26:54
let string_array = cast(&array, &DataType::Utf8).unwrap();
```
**Additional context**
The code exists in arrow to convert strings to timestamps
(`string_to_timestamp_nanos`) and timestamps to strings, but the code is not
connected to the cast kernel
Thus, it is not easy to convert an array of strings to an array of timestamps
--
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]