2013年11月14日

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 Torstan 阅读(517) 评论(0) 推荐(0) 编辑

导航