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

Zheng Shao commented on HIVE-259:
---------------------------------

Jerome, it seems to me that the best data structure for counting is a HashMap, 
which allows near-constant-time insertion, find, and insertion. When we 
"terminate" we can get the entries and sort them but that cost should be small 
(it's one-time cost and the number of unique items won't be too big - users 
should have used "round" to shrink the number of unique numbers).

It seems currently we are paying log(n) cost for each find, and O(n) cost for 
each insertion.

Does that make sense?

For sharing the state object, we can just declare the state class as public 
static.


> Add PERCENTILE aggregate function
> ---------------------------------
>
>                 Key: HIVE-259
>                 URL: https://issues.apache.org/jira/browse/HIVE-259
>             Project: Hadoop Hive
>          Issue Type: New Feature
>          Components: Query Processor
>            Reporter: Venky Iyer
>            Assignee: Jerome Boulon
>         Attachments: HIVE-259.patch
>
>
> Compute atleast 25, 50, 75th percentiles

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to