hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sahil Takiar (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-15982) Support the width_bucket function
Date Wed, 19 Apr 2017 21:55:41 GMT

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

Sahil Takiar commented on HIVE-15982:
-------------------------------------

Thanks for taking a look [~ashutoshc] - I've added an updated patch, the results of the qfile
are now consistent with what Oracle returns. The one exception is that in the attached patch
{{width_bucket(1, 5, 25, 4)}} returns 1. The spec outlined in this JIRA description says that
"If wbo < wbb1, return 1" - it seems Oracle returns 0 rather than 1.

I removed the {{GenericUDF#getConstantLongValue}} method because it isn't used.

> 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, HIVE-15982.2.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)

Mime
View raw message