impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Behm (Code Review)" <>
Subject [Impala-ASF-CR] IMPALA-4848: Add WIDHT BUCKET() function
Date Fri, 24 Feb 2017 02:16:26 GMT
Alex Behm has posted comments on this change.

Change subject: IMPALA-4848: Add WIDHT_BUCKET() function

Patch Set 3:

File be/src/exprs/

Line 437:     error_msg << "Number of buckets:" << num_buckets.val <<
We usually follow this format.

Number of buckets should be greater than zero: <given value goes here>

Line 445:     if (num_buckets.val < INT32_MAX) {
use numeric_limits instead of INT32_MAX

Line 456:   if (bucket_width == numeric_limits<float>::infinity()) {
I don't think infinity is possible unless our min/max range are already weird. I suggest we
check the min/max range for infinity and NaN earlier and remove the check here.

Also, for any such interesting cases we should have tests.

Line 460:   if(bucket_width == 0) return IntVal::null();

Line 461:   double result = (expr.val - min_range.val) / bucket_width + 1;
put parenthesis around the division to make the intended evaluation order clear

Line 462:   if (result == numeric_limits<float>::infinity()) {
Same comment as above for infinity. I don't think we can have infinity here

To view, visit
To unsubscribe, visit

Gerrit-MessageType: comment
Gerrit-Change-Id: I081bc916b1bef7b929ca161a9aade3b54c6b858f
Gerrit-PatchSet: 3
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: anujphadke <>
Gerrit-Reviewer: Alex Behm <>
Gerrit-Reviewer: anujphadke <>
Gerrit-HasComments: Yes

View raw message