有没有办法在Hive中为UDF / UDAF / UDTF添加用户定义的计数器?
答案 0 :(得分:0)
是的, https://issues-test.apache.org/jira/browse/HIVE-3628
示例:
Usage:
public class UDAFEvaluator extends GenericUDAFEvaluator{
@Override
public void iterate(final AggregationBuffer agg, final Object[] parameters) throws HiveException
{ MapredContext.get().getReporter().getCounter(...).increment(1); }
}