@Override public ObjectInspector init(Mode m, ObjectInspector[] parameters) throws HiveException { super.init(m, parameters); // init input object inspectors if (m == Mode.PARTIAL1 || m == Mode.COMPLETE) { inputOI = (PrimitiveObjectInspector) parameters[0]; quantiles = getQuantileArray((ConstantObjectInspector)parameters[1]); if(parameters.length > 2) { nbins = PrimitiveObjectInspectorUtils.getInt( ((ConstantObjectInspector) parameters[2]).getWritableConstantValue(), (PrimitiveObjectInspector)parameters[2]); } } else { loi = (StandardListObjectInspector) parameters[0]; } // Init output object inspectors. // // The return type for a partial aggregation is still a list of doubles, as in // GenericUDAFHistogramNumeric, but we add on the percentile values requested to the // end, and handle serializing/deserializing before we pass things on to the parent // method. // The return type for FINAL and COMPLETE is a full aggregation result, which is a // single double value if (m == Mode.PARTIAL1 || m == Mode.PARTIAL2) { return ObjectInspectorFactory.getStandardListObjectInspector( PrimitiveObjectInspectorFactory.writableDoubleObjectInspector); } else { return PrimitiveObjectInspectorFactory.writableDoubleObjectInspector; } }
@Override public AggregationBuffer getNewAggregationBuffer() throws HiveException { PercentileAggBuf result = new PercentileAggBuf(); result.histogram = new NumericHistogram(); reset(result); return result; }
@Override public ObjectInspector init(Mode m, ObjectInspector[] parameters) throws HiveException { super.init(m, parameters); // init input object inspectors if (m == Mode.PARTIAL1 || m == Mode.COMPLETE) { inputOI = (PrimitiveObjectInspector) parameters[0]; quantilesOI = parameters[1]; if(parameters.length > 2) { nbinsOI = (PrimitiveObjectInspector) parameters[2]; } } else { loi = (StandardListObjectInspector) parameters[0]; } // Init output object inspectors. // // The return type for a partial aggregation is still a list of doubles, as in // GenericUDAFHistogramNumeric, but we add on the percentile values requested to the // end, and handle serializing/deserializing before we pass things on to the parent // method. // The return type for FINAL and COMPLETE is a full aggregation result, which is a // single double value if (m == Mode.PARTIAL1 || m == Mode.PARTIAL2) { return ObjectInspectorFactory.getStandardListObjectInspector( PrimitiveObjectInspectorFactory.writableDoubleObjectInspector); } else { return PrimitiveObjectInspectorFactory.writableDoubleObjectInspector; } }
@Override public ObjectInspector init(Mode m, ObjectInspector[] parameters) throws HiveException { super.init(m, parameters); // init input object inspectors if (m == Mode.PARTIAL1 || m == Mode.COMPLETE) { inputOI = (PrimitiveObjectInspector) parameters[0]; quantilesOI = parameters[1]; if(parameters.length > 2) { nbinsOI = (PrimitiveObjectInspector) parameters[2]; } } else { loi = (StandardListObjectInspector) parameters[0]; } // Init output object inspectors. // // The return type for a partial aggregation is still a list of doubles, as in // GenericUDAFHistogramNumeric, but we add on the percentile values requested to the // end, and handle serializing/deserializing before we pass things on to the parent // method. // The return type for FINAL and COMPLETE is a full aggregation result, which is also // a list of doubles return ObjectInspectorFactory.getStandardListObjectInspector( PrimitiveObjectInspectorFactory.writableDoubleObjectInspector); }
@Override public ObjectInspector init(Mode m, ObjectInspector[] parameters) throws HiveException { super.init(m, parameters); // init input object inspectors if (m == Mode.PARTIAL1 || m == Mode.COMPLETE) { inputOI = (PrimitiveObjectInspector) parameters[0]; quantiles = getQuantileArray((ConstantObjectInspector)parameters[1]); if(parameters.length > 2) { nbins = PrimitiveObjectInspectorUtils.getInt( ((ConstantObjectInspector) parameters[2]).getWritableConstantValue(), (PrimitiveObjectInspector)parameters[2]); } } else { loi = (StandardListObjectInspector) parameters[0]; } // Init output object inspectors. // // The return type for a partial aggregation is still a list of doubles, as in // GenericUDAFHistogramNumeric, but we add on the percentile values requested to the // end, and handle serializing/deserializing before we pass things on to the parent // method. // The return type for FINAL and COMPLETE is a full aggregation result, which is also // a list of doubles return ObjectInspectorFactory.getStandardListObjectInspector( PrimitiveObjectInspectorFactory.writableDoubleObjectInspector); }
@Override public AggregationBuffer getNewAggregationBuffer() throws HiveException { PercentileAggBuf result = new PercentileAggBuf(); result.histogram = new NumericHistogram(); reset(result); return result; }
@Override public ObjectInspector init(Mode m, ObjectInspector[] parameters) throws HiveException { super.init(m, parameters); // init input object inspectors if (m == Mode.PARTIAL1 || m == Mode.COMPLETE) { inputOI = (PrimitiveObjectInspector) parameters[0]; quantiles = getQuantileArray((ConstantObjectInspector)parameters[1]); if(parameters.length > 2) { nbins = PrimitiveObjectInspectorUtils.getInt( ((ConstantObjectInspector) parameters[2]).getWritableConstantValue(), (PrimitiveObjectInspector)parameters[2]); } } else { loi = (StandardListObjectInspector) parameters[0]; } // Init output object inspectors. // // The return type for a partial aggregation is still a list of doubles, as in // GenericUDAFHistogramNumeric, but we add on the percentile values requested to the // end, and handle serializing/deserializing before we pass things on to the parent // method. // The return type for FINAL and COMPLETE is a full aggregation result, which is a // single double value if (m == Mode.PARTIAL1 || m == Mode.PARTIAL2) { return ObjectInspectorFactory.getStandardListObjectInspector( PrimitiveObjectInspectorFactory.writableDoubleObjectInspector); } else { return PrimitiveObjectInspectorFactory.writableDoubleObjectInspector; } }
@Override public ObjectInspector init(Mode m, ObjectInspector[] parameters) throws HiveException { super.init(m, parameters); // init input object inspectors if (m == Mode.PARTIAL1 || m == Mode.COMPLETE) { inputOI = (PrimitiveObjectInspector) parameters[0]; quantiles = getQuantileArray((ConstantObjectInspector)parameters[1]); if(parameters.length > 2) { nbins = PrimitiveObjectInspectorUtils.getInt( ((ConstantObjectInspector) parameters[2]).getWritableConstantValue(), (PrimitiveObjectInspector)parameters[2]); } } else { loi = (StandardListObjectInspector) parameters[0]; } // Init output object inspectors. // // The return type for a partial aggregation is still a list of doubles, as in // GenericUDAFHistogramNumeric, but we add on the percentile values requested to the // end, and handle serializing/deserializing before we pass things on to the parent // method. // The return type for FINAL and COMPLETE is a full aggregation result, which is also // a list of doubles return ObjectInspectorFactory.getStandardListObjectInspector( PrimitiveObjectInspectorFactory.writableDoubleObjectInspector); }
@Override public ObjectInspector init(Mode m, ObjectInspector[] parameters) throws HiveException { super.init(m, parameters); // init input object inspectors if (m == Mode.PARTIAL1 || m == Mode.COMPLETE) { inputOI = (PrimitiveObjectInspector) parameters[0]; quantiles = getQuantileArray((ConstantObjectInspector)parameters[1]); if(parameters.length > 2) { nbins = PrimitiveObjectInspectorUtils.getInt( ((ConstantObjectInspector) parameters[2]).getWritableConstantValue(), (PrimitiveObjectInspector)parameters[2]); } } else { loi = (StandardListObjectInspector) parameters[0]; } // Init output object inspectors. // // The return type for a partial aggregation is still a list of doubles, as in // GenericUDAFHistogramNumeric, but we add on the percentile values requested to the // end, and handle serializing/deserializing before we pass things on to the parent // method. // The return type for FINAL and COMPLETE is a full aggregation result, which is a // single double value if (m == Mode.PARTIAL1 || m == Mode.PARTIAL2) { return ObjectInspectorFactory.getStandardListObjectInspector( PrimitiveObjectInspectorFactory.writableDoubleObjectInspector); } else { return PrimitiveObjectInspectorFactory.writableDoubleObjectInspector; } }
@Override public ObjectInspector init(Mode m, ObjectInspector[] parameters) throws HiveException { super.init(m, parameters); // init input object inspectors if (m == Mode.PARTIAL1 || m == Mode.COMPLETE) { inputOI = (PrimitiveObjectInspector) parameters[0]; quantiles = getQuantileArray((ConstantObjectInspector)parameters[1]); if(parameters.length > 2) { nbins = PrimitiveObjectInspectorUtils.getInt( ((ConstantObjectInspector) parameters[2]).getWritableConstantValue(), (PrimitiveObjectInspector)parameters[2]); } } else { loi = (StandardListObjectInspector) parameters[0]; } // Init output object inspectors. // // The return type for a partial aggregation is still a list of doubles, as in // GenericUDAFHistogramNumeric, but we add on the percentile values requested to the // end, and handle serializing/deserializing before we pass things on to the parent // method. // The return type for FINAL and COMPLETE is a full aggregation result, which is also // a list of doubles return ObjectInspectorFactory.getStandardListObjectInspector( PrimitiveObjectInspectorFactory.writableDoubleObjectInspector); }
@Override public AggregationBuffer getNewAggregationBuffer() throws HiveException { PercentileAggBuf result = new PercentileAggBuf(); result.histogram = new NumericHistogram(); reset(result); return result; }
@Override public AggregationBuffer getNewAggregationBuffer() throws HiveException { PercentileAggBuf result = new PercentileAggBuf(); result.histogram = new NumericHistogram(); reset(result); return result; }