viirya commented on code in PR #2623:
URL: https://github.com/apache/arrow-rs/pull/2623#discussion_r961904069


##########
arrow/src/compute/kernels/cast.rs:
##########
@@ -1502,21 +1503,37 @@ where
 
     if let Some(tz) = tz {
         let mut scratch = Parsed::new();
-        // The macro calls `value_as_datetime_with_tz` on timestamp values of 
the array.
+        // The macro calls `as_datetime` on timestamp values of the array.
         // After applying timezone offset on the datatime, calling `to_string` 
to get
         // the strings.
+        let iter = ArrayIter::new(array);
         extract_component_from_array!(
-            array,
+            iter,
             builder,
             to_string,
-            value_as_datetime_with_tz,
+            |value, tz| as_datetime::<T>(<i64 as From<
+                <T as ArrowPrimitiveType>::Native,
+            >>::from(value))
+            .map(|datetime| datetime + tz),
             tz,
             scratch,
+            |value| as_datetime::<T>(
+                <i64 as From<<T as ArrowPrimitiveType>::Native>>::from(value)
+            ),
             |h| h
         )
     } else {
         // No timezone available. Calling `to_string` on the datatime value 
simply.
-        extract_component_from_array!(array, builder, to_string, 
value_as_datetime, |h| h)
+        let iter = ArrayIter::new(array);

Review Comment:
   Yea



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