@Override public GenericUDAFEvaluator getEvaluator(GenericUDAFParameterInfo info) throws SemanticException { TypeInfo[] parameters = info.getParameters(); GenericUDAFSumEvaluator eval = (GenericUDAFSumEvaluator) getEvaluator(parameters); eval.setWindowing(info.isWindowing()); eval.setSumDistinct(info.isDistinct()); return eval; }
public void sumLong(Iterator<Long> inVals, int inSz, int numPreceding, int numFollowing, Iterator<Long> outVals) throws HiveException { GenericUDAFSum fnR = new GenericUDAFSum(); TypeInfo[] inputTypes = { TypeInfoFactory.longTypeInfo }; ObjectInspector[] inputOIs = { PrimitiveObjectInspectorFactory.writableLongObjectInspector }; LongWritable[] in = new LongWritable[1]; in[0] = new LongWritable(); _agg(fnR, inputTypes, inVals, TypeHandler.LongHandler, in, inputOIs, inSz, numPreceding, numFollowing, outVals); }
break; case "sum": evaluator = (new GenericUDAFSum()).getEvaluator(typeInfos); break; case "avg":
PrimitiveCategory category = GenericUDAFSum.getReturnType(desc.getTypeInfo()); if (category == null) { return null;
PrimitiveCategory category = GenericUDAFSum.getReturnType(desc.getTypeInfo()); if (category == null) { return null;
PrimitiveCategory category = GenericUDAFSum.getReturnType(desc.getTypeInfo()); if (category == null) { return null;
@Override public GenericUDAFEvaluator getEvaluator(GenericUDAFParameterInfo info) throws SemanticException { TypeInfo[] parameters = info.getParameters(); GenericUDAFSumEvaluator eval = (GenericUDAFSumEvaluator) getEvaluator(parameters); eval.setWindowing(info.isWindowing()); eval.setSumDistinct(info.isDistinct()); return eval; }
public void sumDouble(Iterator<Double> inVals, int inSz, int numPreceding, int numFollowing, Iterator<Double> outVals) throws HiveException { GenericUDAFSum fnR = new GenericUDAFSum(); TypeInfo[] inputTypes = { TypeInfoFactory.doubleTypeInfo }; ObjectInspector[] inputOIs = { PrimitiveObjectInspectorFactory.writableDoubleObjectInspector }; DoubleWritable[] in = new DoubleWritable[1]; in[0] = new DoubleWritable(); _agg(fnR, inputTypes, inVals, TypeHandler.DoubleHandler, in, inputOIs, inSz, numPreceding, numFollowing, outVals); }
public void sumHiveDecimal(Iterator<HiveDecimal> inVals, int inSz, int numPreceding, int numFollowing, Iterator<HiveDecimal> outVals) throws HiveException { GenericUDAFSum fnR = new GenericUDAFSum(); TypeInfo[] inputTypes = { TypeInfoFactory.decimalTypeInfo }; ObjectInspector[] inputOIs = { PrimitiveObjectInspectorFactory.writableHiveDecimalObjectInspector }; HiveDecimalWritable[] in = new HiveDecimalWritable[1]; in[0] = new HiveDecimalWritable(); _agg(fnR, inputTypes, inVals, TypeHandler.HiveDecimalHandler, in, inputOIs, inSz, numPreceding, numFollowing, outVals); }