Zoltan Borok-Nagy has posted comments on this change. ( http://gerrit.cloudera.org:8080/11160 )
Change subject: IMPALA-7412: width_bucket() function overflows too easily ...................................................................... Patch Set 4: (1 comment) http://gerrit.cloudera.org:8080/#/c/11160/4/be/src/exprs/math-functions-ir.cc File be/src/exprs/math-functions-ir.cc: http://gerrit.cloudera.org:8080/#/c/11160/4/be/src/exprs/math-functions-ir.cc@514 PS4, Line 514: if (BitUtil::CountLeadingZeros(dist_from_min) + : BitUtil::CountLeadingZeros(static_cast<ActualType>(num_buckets.val)) <= : BitUtil::UnsignedWidth<ActualType>() + 1) { > int min_number_of_leading_zeros_to_avoid_overflow = 8 + 2 -CountLeadingZero Thanks for the explanation! I tried it out but couldn't really measure any performance gain. If you don't mind I'd leave the code as it is because it is a bit more readable/simple. I fixed the issue with the bigger_type_needed flag that we discussed offline. -- To view, visit http://gerrit.cloudera.org:8080/11160 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I728cc05d9aef8d081e6f2da66146f6d7b75dbb57 Gerrit-Change-Number: 11160 Gerrit-PatchSet: 4 Gerrit-Owner: Zoltan Borok-Nagy <[email protected]> Gerrit-Reviewer: Csaba Ringhofer <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Tim Armstrong <[email protected]> Gerrit-Reviewer: Zoltan Borok-Nagy <[email protected]> Gerrit-Comment-Date: Wed, 15 Aug 2018 16:35:22 +0000 Gerrit-HasComments: Yes
