anujphadke has posted comments on this change.

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


Patch Set 1:

Will add a commit message.

Results of the tests match the postgres output.
aphadke-MBP-2:~ aphadke$ 
"/Applications/Postgres.app/Contents/Versions/9.6/bin/psql" -p5432 -d "aphadke"
psql (9.6.1)
Type "help" for help.

aphadke=# 
aphadke=# 
aphadke=# 
aphadke=# 
aphadke=# select width_bucket(6.3, 2, 17, 2);
 width_bucket 
--------------
            1
(1 row)

aphadke=# select width_bucket(11, 6, 14, 3);
 width_bucket 
--------------
            2
(1 row)

aphadke=# select width_bucket(-1, -5, 5, 3);
 width_bucket 
--------------
            2
(1 row)

aphadke=# select width_bucket(1, -5, 5, 3);
 width_bucket 
--------------
            2
(1 row)

aphadke=# select width_bucket(3, 5, 20.1, 4);
 width_bucket 
--------------
            0
(1 row)

aphadke=# select width_bucket(22, 5, 20.1, 4);
 width_bucket 
--------------
            5
(1 row)

aphadke=# select width_bucket(NULL, 2, 14, 4);
 width_bucket 
--------------
             
(1 row)

aphadke=# select width_bucket(NULL, 2, 14, 0);
 width_bucket 
--------------
             
(1 row)

aphadke=# select width_bucket(22, 5, 20.1, 0);
ERROR:  count must be greater than zero
aphadke=# select width_bucket(22, 5, 5, 0);
ERROR:  count must be greater than zero
aphadke=#

-- 
To view, visit http://gerrit.cloudera.org:8080/6023
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I081bc916b1bef7b929ca161a9aade3b54c6b858f
Gerrit-PatchSet: 1
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: anujphadke <apha...@cloudera.com>
Gerrit-Reviewer: anujphadke <apha...@cloudera.com>
Gerrit-HasComments: No

Reply via email to