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 2020/07/16 07:18:18 UTC

[GitHub] [arrow] vvellanki commented on a change in pull request #7782: ARROW-9501: Add logic in timestampdiff() when end date is last day of…

vvellanki commented on a change in pull request #7782:
URL: https://github.com/apache/arrow/pull/7782#discussion_r455560320



##########
File path: cpp/src/gandiva/precompiled/timestamp_arithmetic.cc
##########
@@ -66,7 +96,7 @@ extern "C" {
     if (end_tm.TmMday() < start_tm.TmMday()) {                                        \
       /* case b */                                                                    \
       diff = MONTHS_TO_TIMEUNIT(months_diff - 1, N_MONTHS);                           \
-      return SIGN_ADJUST_DIFF(is_positive, diff);                                     \
+      return SIGN_ADJUST_DIFF(is_positive, diff) + is_last_day_of_month(end_tm);      \

Review comment:
       Change this to:
   is_last_day ? 1 : 0
   
   Lets not add a bool to an int




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

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