hadoop-hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carl Steinbach (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HIVE-894) add udaf max_n, min_n to contrib
Date Thu, 04 Feb 2010 02:20:27 GMT

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

Carl Steinbach commented on HIVE-894:
-------------------------------------

* The patch introduces a lot of checkstyle violations.
* The class is named SortedArrayUtils, but it operates exclusively on Lists? SortedListUtils
would be more accurate.
* I think it would make more sense to create a SortedArrayList class that extends ArrayList
than to provide a Utils class.
** This can be implemented cheaply by extending TreeMap, such that (k,v) is (value, value
count).
* The SortedArrayUtils class references concrete types (ArrayList and Double) instead of interfaces
(List and Comparable).
** If you don't want to make it generic then I think this code should be rolled back into
the UDF classes since in its present form it doesn't earn the "Util" moniker.
* It should be possible to create a common base class for Min and Max implementations and
share nearly all of the code. The only difference between the two is the comparator.


> add udaf max_n, min_n to contrib
> --------------------------------
>
>                 Key: HIVE-894
>                 URL: https://issues.apache.org/jira/browse/HIVE-894
>             Project: Hadoop Hive
>          Issue Type: New Feature
>    Affects Versions: 0.6.0
>            Reporter: Zheng Shao
>            Assignee: Zheng Shao
>         Attachments: HIVE-894.1.patch, HIVE-894.1.patch, HIVE-894.2.patch
>
>
> These 2 UDAFs should return the max n numbers, min n numbers in order.
> {code}
> SELECT max_n(userid, 3) FROM src;
> [999,997,996]
> SELECT max_n(userid, 3)[1] FROM src;
> 997
> SELECT min_n(userid, 3) FROM src;
> [0, 3, 8]
> SELECT min_n(userid, 3)[2] FROM src;
> 8
> {code}

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


Mime
View raw message