impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Armstrong (Code Review)" <>
Subject [Impala-ASF-CR] IMPALA-5019: Decimal V2 addition
Date Mon, 30 Oct 2017 21:12:06 GMT
Tim Armstrong has posted comments on this change. ( )

Change subject: IMPALA-5019: Decimal V2 addition

Patch Set 3:


I'm gradually understanding this better. Had some further suggestions to make it easier to
follow but I think I'm getting close.
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 into the left.
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 making the caller
responsible for switching the arguments? I think it would be easier to follow because there's
one less case to handle.
File be/src/runtime/decimal-value.inline.h:
PS2, Line 305:     RESULT_T y = 0;
> Delta scale is different in AdjustToSameScale(). There are two delta scales
Ah ok. I wonder if renaming the variable would make it clearer. Something like result_scale_delta
to make it clearer that it's between the result scale and something else? Or result_scale_decrease
to indicate that we need to scale down the result by this amount.
PS2, Line 310:   }
> Added comment.
Thanks. I still think something is missing in the AdjustToSameScale() name or comment, since
I couldn't tell that it was intended to adjust them to the max scale without reading the code.
Maybe it just needs a comment explaining how the output scale is computed.

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: Mon, 30 Oct 2017 21:12:06 +0000
Gerrit-HasComments: Yes

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