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-4939, IMPALA-4940: Decimal V2 multiplication
Date Fri, 29 Sep 2017 23:23:02 GMT
Dan Hecht has posted comments on this change. ( )

Change subject: IMPALA-4939, IMPALA-4940: Decimal V2 multiplication

Patch Set 6:


mostly just some questions.
Commit Message:
PS6, Line 67:   after:  126.17s
is it always the case that this regression is in cases that would have (incorrectly) returned
null before this change?
File be/src/runtime/decimal-value.inline.h:
PS6, Line 253: 
great to see that go away
PS6, Line 245: overflow
instead of saying "we will overflow", I think "we indicate overflow" or "return overflow"
or something like that. I was trying to figure out where the overflow occurs until I continued
PS6, Line 244: If delta scale is 0, we need to do a more precise check if converting to 256
             :       // is necessary
I don't understand that comment, given that line 240-241 says the first check was conservative.
PS6, Line 273:       // with a delta_scale 39 does not fit into int128.
so normally the (38,38) * (38,38) case would be handled in the needs_int256 case, is that
right?  is this case just when the values are so small that they turn into 0?
PS6, Line 284: 
nit: let's eliminate this blank line (and maybe others. this function already barely fits
on one screen which is important for readability.
File be/src/util/bit-util.h:
PS6, Line 292:     __int128 shifted = v >> 64;
             :     if (shifted > 0) {
given that 'v' is unsigned, won't the shift be unsigned, meaning 'shifted' will always get
zeros in the top 64, meaning shifted is always >= 0?  oh, so is this really just checking
"shifted != 0"?  If so, that seems clearer, especially since the else-clause only makes sense
for 0, not for negative.

To view, visit
To unsubscribe, visit

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I37ad6232d7953bd75c18dc86e665b2b501a1ebe1
Gerrit-Change-Number: 7438
Gerrit-PatchSet: 6
Gerrit-Owner: Taras Bobrovytsky <>
Gerrit-Reviewer: Dan Hecht <>
Gerrit-Reviewer: Jim Apple <>
Gerrit-Reviewer: Michael Ho <>
Gerrit-Reviewer: Taras Bobrovytsky <>
Gerrit-Reviewer: Tim Armstrong <>
Gerrit-Reviewer: Zach Amsden <>
Gerrit-Comment-Date: Fri, 29 Sep 2017 23:23:02 +0000
Gerrit-HasComments: Yes

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