tustvold commented on code in PR #4773:
URL: https://github.com/apache/arrow-rs/pull/4773#discussion_r1376064707
##########
parquet_derive/src/parquet_field.rs:
##########
@@ -348,6 +418,48 @@ impl Field {
}
}
+ // generates code to read a vector `records` into `field_name` for each
record
+ 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]
+ + ((::chrono::naive::NaiveDate::from_ymd_opt(1970, 1,
1).unwrap()
+ .signed_duration_since(
+ ::chrono::naive::NaiveDate::from_ymd_opt(0, 12,
31).unwrap()
Review Comment:
```suggestion
::chrono::naive::NaiveDate::from_num_days_from_ce_opt(0)
```
I found the use of 12, 31 rather confusing
--
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]