Joseph-Rance commented on code in PR #4773:
URL: https://github.com/apache/arrow-rs/pull/4773#discussion_r1375484474


##########
parquet_derive/src/parquet_field.rs:
##########
@@ -348,6 +417,47 @@ impl Field {
         }
     }
 
+    fn copied_direct_fields(&self) -> proc_macro2::TokenStream {
+        let field_name = &self.ident;
+
+        let value = match self.third_party_type {
+            Some(ThirdPartyType::ChronoNaiveDateTime) => {
+                quote! { 
::chrono::naive::NaiveDateTime::from_timestamp_millis(vals[i]).unwrap() }
+            }
+            Some(ThirdPartyType::ChronoNaiveDate) => {
+                quote! {
+                    
::chrono::naive::NaiveDate::from_num_days_from_ce_opt(vals[i]

Review Comment:
   I'm not sure exactly what your question related to, but this logic for 
getting the `NaiveDate` is just the inverse of above. However, there is no 
function `from_signed_duration_since` that mirrors the `signed_duration_since` 
function we are using above, so I had to use `from_num_days_from_ce_opt`, which 
uses a different date to measure days from. That's why we need to add on the 
number of days between that other date and 01/01/1970.



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