Tim Armstrong has posted comments on this change. Change subject: IMPALA-4433: Fix undefined NDV calculations ......................................................................
Patch Set 1: (4 comments) http://gerrit.cloudera.org:8080/#/c/5004/1//COMMIT_MSG Commit Message: Line 10: argument is 0. This patch handles that 0 case. Might be good to mention that varies depending on the architecture. http://gerrit.cloudera.org:8080/#/c/5004/1/be/src/exprs/aggregate-functions-ir.cc File be/src/exprs/aggregate-functions-ir.cc: Line 1175: if (hash_value != 0) { Same comment as the other place - I think we can remove this branch. http://gerrit.cloudera.org:8080/#/c/5004/1/be/src/udf_samples/hyperloglog-uda.cc File be/src/udf_samples/hyperloglog-uda.cc: Line 75: if (hash_value != 0) { Let's remove this branch while we're at it. It doesn't make sense to me why it's there in the first place and I don't think it's consequential (if you think about it, getting a hash value of 0 should be extremely rare and not affect the final probabilistic result). I wonder if the branch was originally an attempt to work around the problem you're fixing. PS1, Line 81: hash_top_bits ? __builtin_ctzll(hash_top_bits) : : (sizeof(hash_value) * CHAR_BIT - HLL_PRECISION) Can't we use the builtin you -- To view, visit http://gerrit.cloudera.org:8080/5004 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8460bc3f7e510ce07b8673387c9440accc432abe Gerrit-PatchSet: 1 Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-Owner: Jim Apple <[email protected]> Gerrit-Reviewer: Amos Bird <[email protected]> Gerrit-Reviewer: Tim Armstrong <[email protected]> Gerrit-HasComments: Yes
