Exemple #1
0
 @Override
 public void reset(AggregationBuffer agg) throws HiveException {
   SumLongAgg myagg = (SumLongAgg) agg;
   myagg.empty = true;
   myagg.sum = 0L;
   myagg.uniqueObjects = new HashSet<ObjectInspectorObject>();
 }
Exemple #2
0
 @Override
 public void merge(AggregationBuffer agg, Object partial) throws HiveException {
   if (partial != null) {
     SumLongAgg myagg = (SumLongAgg) agg;
     myagg.empty = false;
     if (isWindowingDistinct()) {
       throw new HiveException(
           "Distinct windowing UDAF doesn't support merge and terminatePartial");
     } else {
       myagg.sum += PrimitiveObjectInspectorUtils.getLong(partial, inputOI);
     }
   }
 }