public void aggregate(AggregationBuffer agg, Object[] parameters) throws HiveException {
    if (mode == Mode.PARTIAL1 || mode == Mode.COMPLETE) {
      iterate(agg, parameters);
    } else {
      // extra parameters are only used to initialize the UDAFs, it's OK
      // to ignore them here and keep the column parameter (the first one)
      merge(agg, parameters[0]);
    }
  }
This function will be called by GroupByOperator when it sees a new input
row.

@param agg
         The object to store the aggregation result.
@param parameters
         The row, can be inspected by the OIs passed in init().
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFEvaluator.java