commit | 86409b4347582e3de1c02fc99a20e8d7bb7706cf | [log] [tgz] |
---|---|---|
author | Makoto Yui <myui@apache.org> | Fri Nov 22 23:17:11 2019 +0900 |
committer | Makoto Yui <myui@apache.org> | Fri Nov 22 23:17:11 2019 +0900 |
tree | cbaad8d6fdee324b40f89ab59cbd29f26f8cdbba | |
parent | 3aad359fbde7fd5028f9042884588eeb362cd2af [diff] |
[HIVEMALL-281] Support max_by, min_by, majority_vote UDAFs ## What changes were proposed in this pull request? upport max_by, min_by, majority_vote UDAFs ## What type of PR is it? Feature ## What is the Jira issue? https://issues.apache.org/jira/browse/HIVEMALL-281 ## How was this patch tested? manual tests on EMR ## How to use this feature? ```sql create table data1 as ( select 'jake' as name, 18 as age union all select 'tom' as name, 64 as age union all select 'lisa' as name, 32 as age ); select max_by(name, age) as max_name, min_by(name, age) as min_name from data1; > tom, jake create table data2 as select explode(array('1', '2', '2', '2', '5', '4', '1', '2')) as k; select majority_vote(k) as k from data2; > 2 ``` ## Checklist (Please remove this section if not needed; check `x` for YES, blank for NO) - [x] Did you apply source code formatter, i.e., `./bin/format_code.sh`, for your commit? - [x] Did you run system tests on Hive (or Spark)? Author: Makoto Yui <myui@apache.org> Closes #214 from myui/HIVEMALL-281.
Apache Hivemall is a scalable machine learning library that runs on Apache Hive, Apache Spark, and Apache Pig. Hivemall is designed to be scalable to the number of training instances as well as the number of training features.
Find more examples on our user guide and find a brief introduction to Hivemall in this slide.
Support is through user@hivemall.incubator.apache.org, not by a direct e-mail.
If you are planning to contribute to this repository, we first request you to create an issue at our JIRA page even if the topic is not related to source code itself (e.g., documentation, new idea and proposal).
All Hivemall functions are defined under resources/ddl. In order to update the definition files, the following script helps inserting function name and class path of your new UDF:
$ ./bin/update_ddls.sh
Moreover, don't forget to update function list in the document as well:
$ ./bin/update_func_md.sh
Note that, before creating a pull request including Java code, please make sure your code follows our coding conventions by applying formatter:
$ ./bin/format_code.sh