You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "tustvold (via GitHub)" <gi...@apache.org> on 2023/03/10 10:56:19 UTC

[GitHub] [arrow-rs] tustvold commented on a diff in pull request #3835: Support timestamp/time and date json decoding

tustvold commented on code in PR #3835:
URL: https://github.com/apache/arrow-rs/pull/3835#discussion_r1132231093


##########
arrow-json/src/raw/mod.rs:
##########
@@ -293,6 +293,16 @@ fn make_decoder(
         data_type => (primitive_decoder, data_type),
         DataType::Float32 => primitive_decoder!(Float32Type, data_type),
         DataType::Float64 => primitive_decoder!(Float64Type, data_type),
+        DataType::Timestamp(TimeUnit::Second, _) => primitive_decoder!(TimestampSecondType, data_type),
+        DataType::Timestamp(TimeUnit::Millisecond, _) => primitive_decoder!(TimestampMillisecondType, data_type),
+        DataType::Timestamp(TimeUnit::Microsecond, _) => primitive_decoder!(TimestampMicrosecondType, data_type),
+        DataType::Timestamp(TimeUnit::Nanosecond, _) => primitive_decoder!(TimestampNanosecondType, data_type),

Review Comment:
   ```suggestion
           DataType::Timestamp(TimeUnit::Second, None) => primitive_decoder!(TimestampSecondType, data_type),
           DataType::Timestamp(TimeUnit::Millisecond, None) => primitive_decoder!(TimestampMillisecondType, data_type),
           DataType::Timestamp(TimeUnit::Microsecond, None) => primitive_decoder!(TimestampMicrosecondType, data_type),
           DataType::Timestamp(TimeUnit::Nanosecond, None) => primitive_decoder!(TimestampNanosecondType, data_type),
   ```
   
   I think this code doesn't correctly handle timestamps, in particular the returned arrays won't have the timestamp set. 
   
   There is also an issue with the way the Parser implementation in general handles timezones - https://github.com/apache/arrow-rs/issues/1936
   
   I would just leave off support for now



-- 
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: github-unsubscribe@arrow.apache.org

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