super.init(m, parameters);
result = new HiveDecimalWritable(HiveDecimal.ZERO);
inputOI = (PrimitiveObjectInspector) parameters[0];
// The output precision is 10 greater than the input which should cover at least
// 10b rows. The scale is the same as the input.
DecimalTypeInfo outputTypeInfo = null;
if (mode == Mode.PARTIAL1 || mode == Mode.COMPLETE) {
int precision = Math.min(HiveDecimal.MAX_PRECISION, inputOI.precision() + 10);
outputTypeInfo = TypeInfoFactory.getDecimalTypeInfo(precision, inputOI.scale());
} else {
outputTypeInfo = (DecimalTypeInfo) inputOI.getTypeInfo();