Taras Bobrovytsky has posted comments on this change. ( http://gerrit.cloudera.org:8080/8833 )
Change subject: IMPALA-6300: Fix decimal modulo overflow ...................................................................... Patch Set 1: (5 comments) http://gerrit.cloudera.org:8080/#/c/8833/1/be/src/runtime/decimal-value.inline.h File be/src/runtime/decimal-value.inline.h: http://gerrit.cloudera.org:8080/#/c/8833/1/be/src/runtime/decimal-value.inline.h@190 PS1, Line 190: int y_lz = BitUtil::CountLeadingZeros<T>(abs(y)); > Ouch ? http://gerrit.cloudera.org:8080/#/c/8833/1/be/src/runtime/decimal-value.inline.h@261 PS1, Line 261: #ifdef DEBUG > Is there some way we can avoid having different control flow on release and Done. The compiler should optimize it away if it's false, right? http://gerrit.cloudera.org:8080/#/c/8833/1/be/src/runtime/decimal-value.inline.h@361 PS1, Line 361: RESULT_T x = 0; > Unnecessary change - can you revert? Done http://gerrit.cloudera.org:8080/#/c/8833/1/be/src/runtime/decimal-value.inline.h@571 PS1, Line 571: result = x % y; > I think it would probably be faster and simpler to just use 64-bit arithmet Done. I ran a benchmark and it turns that it is indeed better to simply use 64-bit arithmetic. http://gerrit.cloudera.org:8080/#/c/8833/1/be/src/runtime/decimal-value.inline.h@641 PS1, Line 641: return true; > Since this can never be true if callers respect the comment above, maybe th Good idea. We can simply remove this. The DCHECK is inside SafeMultiply(). -- To view, visit http://gerrit.cloudera.org:8080/8833 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I27c7f25f68353c19c315e1639311ec06b2dea686 Gerrit-Change-Number: 8833 Gerrit-PatchSet: 1 Gerrit-Owner: Taras Bobrovytsky <[email protected]> Gerrit-Reviewer: Taras Bobrovytsky <[email protected]> Gerrit-Reviewer: Tim Armstrong <[email protected]> Gerrit-Reviewer: Zach Amsden <[email protected]> Gerrit-Comment-Date: Fri, 15 Dec 2017 02:42:09 +0000 Gerrit-HasComments: Yes
