impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Taras Bobrovytsky (Code Review)" <>
Subject [Impala-ASF-CR] IMPALA-5019: Decimal V2 addition
Date Tue, 07 Nov 2017 01:43:37 GMT
Taras Bobrovytsky has posted comments on this change. (

Change subject: IMPALA-5019: Decimal V2 addition

Patch Set 3:

File be/src/runtime/decimal-value.inline.h:
PS3, Line 179:     int128_t& x_left, int128_t& x_right, int128_t& y_left, int128_t&
y_right) {
> Use pointers for output arguments:
PS3, Line 214: right_overflow
> carry_to_left might be a better name? Since the intent is to carry this int
Agreed, changed.
PS3, Line 243: inline int128_t SubtractLarge(int128_t x, int x_scale, int128_t y, int y_scale,
> What do you think about make it so that this always computes x - y, and mak
The way it is currently implemented, I don't see an advantage in doing that. We do not use
the subtraction operation in this function, we still add x and y together.

Are you suggesting to rewrite it, so that x and y are both expected to be positive and we
will be doing x - y here? It's not quite clear to me which case would be eliminated if we
rewrite it that way. (Both cases on line 264 would still need to be present)
File be/src/runtime/decimal-value.inline.h:
PS2, Line 305:     RESULT_T y = 0;
> Ah ok. I wonder if renaming the variable would make it clearer. Something l
Ranamed to result_scale_decrease
PS2, Line 310:   }
> Thanks. I still think something is missing in the AdjustToSameScale() name 
Modified the comment of AdjustToSameScale() slightly. I was  debating changing the name to
AdjustToMaxScale(), but that might be confusing (because max scale is 38)).

To view, visit
To unsubscribe, visit

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I401049c56d910eb1546a178c909c923b01239336
Gerrit-Change-Number: 8309
Gerrit-PatchSet: 3
Gerrit-Owner: Taras Bobrovytsky <>
Gerrit-Reviewer: Michael Ho <>
Gerrit-Reviewer: Taras Bobrovytsky <>
Gerrit-Reviewer: Tim Armstrong <>
Gerrit-Reviewer: Zach Amsden <>
Gerrit-Comment-Date: Tue, 07 Nov 2017 01:43:37 +0000
Gerrit-HasComments: Yes

  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message