impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Armstrong (Code Review)" <ger...@cloudera.org>
Subject [Impala-ASF-CR] IMPALA-4433: Fix undefined NDV calculations
Date Tue, 08 Nov 2016 21:29:41 GMT
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 <jbapple@cloudera.com>
Gerrit-Reviewer: Amos Bird <amosbird@gmail.com>
Gerrit-Reviewer: Tim Armstrong <tarmstrong@cloudera.com>
Gerrit-HasComments: Yes

Mime
View raw message