waitingkuo commented on code in PR #3072:
URL: https://github.com/apache/arrow-rs/pull/3072#discussion_r1018585675


##########
arrow-array/src/array/primitive_array.rs:
##########
@@ -551,11 +551,33 @@ impl<T: ArrowPrimitiveType> std::fmt::Debug for 
PrimitiveArray<T> {
                     None => write!(f, "null"),
                 }
             }
-            DataType::Timestamp(_, _) => {
+            DataType::Timestamp(_, tz_string_opt) => {
                 let v = self.value(index).to_isize().unwrap() as i64;
-                match as_datetime::<T>(v) {
-                    Some(datetime) => write!(f, "{:?}", datetime),
-                    None => write!(f, "null"),
+                match tz_string_opt {
+                    // for Timestamp with TimeZone
+                    Some(tz_string) => {
+                        match tz_string.parse::<Tz>() {
+                            // if the time zone is valid, construct a 
DateTime<Tz> and format it as rfc3339
+                            Ok(tz) => match as_datetime_with_timezone::<T>(v, 
tz) {
+                                Some(datetime) => write!(f, "{}", 
datetime.to_rfc3339()),
+                                None => write!(f, "null"),
+                            },

Review Comment:
   outputs to rfc3339 format if tz parsed successfully



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