[ 
https://issues.apache.org/jira/browse/HIVE-15982?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15973721#comment-15973721
 ] 

Ashutosh Chauhan commented on HIVE-15982:
-----------------------------------------

* Executing select width_bucket(1, 5, 25, 4), width_bucket(10, 5, 25, 4), 
width_bucket(20, 5, 25, 4), width_bucket(30, 5, 25, 4) from dual; on oracle 
yields  0 2       4       5 which is different than your test case.
* You may use PrimitiveObjectInspectorUtils::getLong() instead of writing 
custom function to extract long values.

> Support the width_bucket function
> ---------------------------------
>
>                 Key: HIVE-15982
>                 URL: https://issues.apache.org/jira/browse/HIVE-15982
>             Project: Hive
>          Issue Type: Sub-task
>          Components: SQL
>            Reporter: Carter Shanklin
>            Assignee: Sahil Takiar
>         Attachments: HIVE-15982.1.patch
>
>
> Support the width_bucket(wbo, wbb1, wbb2, wbc) which returns an integer 
> between 0 and wbc+1 by mapping wbo into the ith equally sized bucket made by 
> dividing wbb1 and wbb2 into equally sized regions. If wbo < wbb1, return 1, 
> if wbo > wbb2 return wbc+1. Reference: SQL standard section 4.4.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to