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/12/20 14:50:20 UTC

[GitHub] [arrow-rs] alamb opened a new issue #1065: Incorrect Numeric operations on MONTH_DAY_NANO interval type

alamb opened a new issue #1065:
URL: https://github.com/apache/arrow-rs/issues/1065


   **Describe the bug**
   Pointed out by @jorgecarleitao  and @b41sh  on https://github.com/apache/arrow-rs/pull/779#discussion_r763641073
   
   > Semantically, the numerics of an i128 are not the same as the numerics of (months,days,nanos) since i128 + i128 != (months, days,nanos) + (months, days,nanos).
   
   > The consequence of defining this type numerically here is that arithmetic kernels will accept this type, but they will yield a semantically incorrect result (e.g. i128 + i128 to sum two intervals of 1 month each).
   
   **To Reproduce**
   Do a numerical operation on two arrays of `MonthDayNano` type (for example add or subtract them). The arithmetic will be performed directly on the `i128` representation rather than field by field
   
   **Expected behavior**
   The intervals should be calculated field by field; So for example to add two `MonthDayNano` fields, the kernels should add the nanoseconds, days and months separately
   
   **Additional context**
   


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



[GitHub] [arrow-rs] houqp commented on issue #1065: Incorrect Numeric operations on MONTH_DAY_NANO interval type

Posted by GitBox <gi...@apache.org>.
houqp commented on issue #1065:
URL: https://github.com/apache/arrow-rs/issues/1065#issuecomment-1000924387


   It might be better to disallow arithmetic for this type because number of days in a month and number of nanos in a day is different depending on the reference point of time you are in. So there is no perfect way to handle it. Compute engines can choose their own tradeoffs and implement arithmetic and ordering downstream.


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