get top k elements of the same key in hive
摘要:key points:1. group by key and sort by using distribute by and sort by.2. get top k elements by a UDF (user defined function) RANK---------Here is the source code.--------------package com.example.hive.udf;import org.apache.hadoop.hive.ql.exec.UDF; public final class Rank extends UDF{ priv...
阅读全文
posted @ 2013-11-14 19:17