You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/01/19 13:23:43 UTC

[GitHub] [arrow] alamb commented on a change in pull request #9263: ARROW-11318: [Rust] Support pretty printing timestamp, date, and timestamp types

alamb commented on a change in pull request #9263:
URL: https://github.com/apache/arrow/pull/9263#discussion_r560171845



##########
File path: rust/arrow/src/util/display.rs
##########
@@ -104,30 +155,30 @@ pub fn array_value_to_string(column: &array::ArrayRef, row: usize) -> Result<Str
         DataType::Float32 => make_string!(array::Float32Array, column, row),
         DataType::Float64 => make_string!(array::Float64Array, column, row),
         DataType::Timestamp(unit, _) if *unit == TimeUnit::Second => {
-            make_string!(array::TimestampSecondArray, column, row)
+            make_string_datetime!(array::TimestampSecondArray, column, row)
         }
         DataType::Timestamp(unit, _) if *unit == TimeUnit::Millisecond => {
-            make_string!(array::TimestampMillisecondArray, column, row)
+            make_string_datetime!(array::TimestampMillisecondArray, column, row)
         }
         DataType::Timestamp(unit, _) if *unit == TimeUnit::Microsecond => {
-            make_string!(array::TimestampMicrosecondArray, column, row)
+            make_string_datetime!(array::TimestampMicrosecondArray, column, row)
         }
         DataType::Timestamp(unit, _) if *unit == TimeUnit::Nanosecond => {
-            make_string!(array::TimestampNanosecondArray, column, row)
+            make_string_datetime!(array::TimestampNanosecondArray, column, row)
         }
-        DataType::Date32(_) => make_string!(array::Date32Array, column, row),
-        DataType::Date64(_) => make_string!(array::Date64Array, column, row),
+        DataType::Date32(_) => make_string_date!(array::Date32Array, column, row),
+        DataType::Date64(_) => make_string_date!(array::Date64Array, column, row),
         DataType::Time32(unit) if *unit == TimeUnit::Second => {
-            make_string!(array::Time32SecondArray, column, row)
+            make_string_time!(array::Time32SecondArray, column, row)
         }
         DataType::Time32(unit) if *unit == TimeUnit::Millisecond => {
-            make_string!(array::Time32MillisecondArray, column, row)
+            make_string_time!(array::Time32MillisecondArray, column, row)
         }
-        DataType::Time32(unit) if *unit == TimeUnit::Microsecond => {
-            make_string!(array::Time64MicrosecondArray, column, row)
+        DataType::Time64(unit) if *unit == TimeUnit::Microsecond => {

Review comment:
       There was actually a bug here -- there is no such type as using `Time32` for storing Microseconds -- it is actually `Time64` (as can be seen in the `Time64MicrosecondArray` type below it)




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org