tustvold commented on issue #3664:
URL: https://github.com/apache/arrow-rs/issues/3664#issuecomment-1418788640

   > however input array can have mixed timezones,
   
   My naive expectation in such a case is that it would cast the timestamps to 
the provided output timezone. So in your example
   
   ```
   let valid = StringArray::from(vec![
       "2023-01-01 04:05:06.789-8",
       "2023-01-01 04:05:06.789-7",
   ]);
   let array = Arc::new(valid) as ArrayRef;
   let b = cast(&array, &DataType::Timestamp(TimeUnit::Nanosecond, 
Some("+02:00".to_string()))).unwrap();
   ```
   
   Would result in
   
   ```
   "2023-01-01 14:05:06.789+2"
   "2023-01-01 13:05:06.789+2"
   ```
   
   Or to put it differently, each row would be parsed with any FixedOffset 
specific to that row, and it would then be converted to the output timezone
   
   > Probably cast functions should accept array type TimestampNanosecondArray 
instead of primitive type DataType::Timestamp
   
   I don't follow what you mean by this
   
   
   


-- 
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]

Reply via email to