impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dan Hecht (Code Review)" <>
Subject [Impala-ASF-CR] IMPALA-4813: Round on divide and multiply
Date Tue, 28 Feb 2017 00:47:41 GMT
Dan Hecht has posted comments on this change.

Change subject: IMPALA-4813: Round on divide and multiply

Patch Set 4:


Just some minor comments about the code.  Once you address these and fill out the test cases
for the various code paths, I can take a final look.
File be/src/runtime/decimal-value.h:

PS4, Line 122: /* round */ false
this should pass 'round'
File be/src/runtime/decimal-value.inline.h:

Line 194: namespace detail {
add a function comment.

PS4, Line 198: be

Line 205:     // here that it is a power of two.
I think you mean "even" (or "power of ten"), not "power of two".

how about adding a dcheck to document that it's even.

Line 283:   *overflow |= abs(result) > DecimalUtil::MAX_UNSCALED_DECIMAL16;
shouldn't this have the:

if (result_precision == MAX_PRECISION)

guard around it too?

PS4, Line 311: 2 * remainder
do we know this can't overflow? can you comment on that (and maybe add DCHECK to justify it)?
File be/src/util/

Line 37:   EXPECT_EQ(BitUtil::UnsignedWidth<char>(), 7);
this is implementation dependent. maybe say "signed char" to remove that dependency.

Line 60:   EXPECT_EQ(BitUtil::IncrementAwayFromZero<int128_t>(-200), -201);
what happens with the 256 bit type we use in decimal code? does this work?
File fe/src/main/java/org/apache/impala/analysis/

Line 266: //        }
please remove this from this diff. it should go in IMPALA-4940 change. (also the if-stmt is
what is in createAdjustedDecimalType() which is called on line 275).

To view, visit
To unsubscribe, visit

Gerrit-MessageType: comment
Gerrit-Change-Id: Ie6bfcbe37555b74598d409c6f84f06b0ae5c4312
Gerrit-PatchSet: 4
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Zach Amsden <>
Gerrit-Reviewer: Dan Hecht <>
Gerrit-Reviewer: Michael Ho
Gerrit-Reviewer: Zach Amsden <>
Gerrit-HasComments: Yes

View raw message