impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dan Hecht (Code Review)" <ger...@cloudera.org>
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:

(9 comments)

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.

http://gerrit.cloudera.org:8080/#/c/6132/4/be/src/runtime/decimal-value.h
File be/src/runtime/decimal-value.h:

PS4, Line 122: /* round */ false
this should pass 'round'


http://gerrit.cloudera.org:8080/#/c/6132/4/be/src/runtime/decimal-value.inline.h
File be/src/runtime/decimal-value.inline.h:

Line 194: namespace detail {
add a function comment.


PS4, Line 198: be
garbled


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


http://gerrit.cloudera.org:8080/#/c/6132/4/be/src/util/bit-util-test.cc
File be/src/util/bit-util-test.cc:

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?


http://gerrit.cloudera.org:8080/#/c/6132/4/fe/src/main/java/org/apache/impala/analysis/TypesUtil.java
File fe/src/main/java/org/apache/impala/analysis/TypesUtil.java:

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 http://gerrit.cloudera.org:8080/6132
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

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

Mime
View raw message