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 2022/07/31 21:37:08 UTC

[GitHub] [arrow-rs] viirya commented on a diff in pull request #2235: Update `IntervalMonthDayNanoType::make_value()` to conform to specifications

viirya commented on code in PR #2235:
URL: https://github.com/apache/arrow-rs/pull/2235#discussion_r934042444


##########
arrow/src/datatypes/types.rs:
##########
@@ -232,6 +232,16 @@ impl IntervalDayTimeType {
         days: i32,
         millis: i32,
     ) -> <IntervalDayTimeType as ArrowPrimitiveType>::Native {
+        /*
+        https://github.com/apache/arrow/blob/02c8598d264c839a5b5cf3109bfd406f3b8a6ba5/cpp/src/arrow/type.h#L1433
+        struct DayMilliseconds {
+            int32_t days = 0;
+            int32_t milliseconds = 0;

Review Comment:
   Without closing bracket, it reads uncomfortable... 😄 
   
   ```suggestion
           struct DayMilliseconds {
               int32_t days = 0;
               int32_t milliseconds = 0;
               ...
           }
   ```



##########
arrow/src/datatypes/types.rs:
##########
@@ -264,9 +274,20 @@ impl IntervalMonthDayNanoType {
         days: i32,
         nanos: i64,
     ) -> <IntervalMonthDayNanoType as ArrowPrimitiveType>::Native {
-        let m = months as u128 & u32::MAX as u128;
-        let d = (days as u128 & u32::MAX as u128) << 32;
-        let n = (nanos as u128) << 64;
+        /*
+        https://github.com/apache/arrow/blob/02c8598d264c839a5b5cf3109bfd406f3b8a6ba5/cpp/src/arrow/type.h#L1475
+        struct MonthDayNanos {
+            int32_t months;
+            int32_t days;
+            int64_t nanoseconds;

Review Comment:
   ditto



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