doki23 commented on issue #1936:
URL: https://github.com/apache/arrow-rs/issues/1936#issuecomment-1253131853

   We consider tz only if from_type and to_type both needs it. For example, 
ignoring tz is ok when we cast ts to i64, because i64 array doesn't care about 
timezone.
   
   So, there're 2 situations:
   
   1. ts is from_type, and the to_type needs tz.
   2. ts is to_type, and the from_type has tz.
   
   - when ts is from type
   I noticed that timestamp array is always treat as `PrimitiveArray`. We can't 
get tz from `ArrowPrimitiveType::DATA_TYPE`, because there're only utc ts 
definitions like:
   ```rust
   make_type!(
       TimestampSecondType,
       i64,
       DataType::Timestamp(TimeUnit::Second, None)
   );
   ```
   So, `ArrayData::data_type` makes sense. 
   
   - ts is to type
   We may need a `TimestampBuilder::from` in place of 
`TimestampSecondArray::from_xxx` which can realize the timezone.


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