@Override public void iterate(AggregationBuffer agg, Object[] parameters) throws HiveException { NumericStatsAgg myagg = (NumericStatsAgg) agg; if (myagg.numDV == null) { int numVectors = parameters[1] == null ? 0 : PrimitiveObjectInspectorUtils.getInt(parameters[1], numVectorsOI); if (numVectors > MAX_BIT_VECTORS) { throw new HiveException("The maximum allowed value for number of bit vectors " + " is " + MAX_BIT_VECTORS + ", but was passed " + numVectors + " bit vectors"); } myagg.initNDVEstimator(numVectors); } //Update null counter if a null value is seen if (parameters[0] == null) { myagg.countNulls++; } else { try { myagg.update(parameters[0], inputOI); } catch (NumberFormatException e) { if (!warned) { warned = true; LOG.warn(getClass().getSimpleName() + " " + StringUtils.stringifyException(e)); LOG.warn(getClass().getSimpleName() + " ignoring similar exceptions."); } } } }
@Override public void iterate(AggregationBuffer agg, Object[] parameters) throws HiveException { NumericStatsAgg myagg = (NumericStatsAgg) agg; if (myagg.numDV == null) { int numVectors = parameters[1] == null ? 0 : PrimitiveObjectInspectorUtils.getInt(parameters[1], numVectorsOI); if (numVectors > MAX_BIT_VECTORS) { throw new HiveException("The maximum allowed value for number of bit vectors " + " is " + MAX_BIT_VECTORS + ", but was passed " + numVectors + " bit vectors"); } myagg.initNDVEstimator(numVectors); } //Update null counter if a null value is seen if (parameters[0] == null) { myagg.countNulls++; } else { try { myagg.update(parameters[0], inputOI); } catch (NumberFormatException e) { if (!warned) { warned = true; LOG.warn(getClass().getSimpleName() + " " + StringUtils.stringifyException(e)); LOG.warn(getClass().getSimpleName() + " ignoring similar exceptions."); } } } }
@Override public void iterate(AggregationBuffer agg, Object[] parameters) throws HiveException { NumericStatsAgg myagg = (NumericStatsAgg) agg; if (myagg.numDV == null) { String func = null; int numVectors = 0; // func may be null when GBY op is closing. // see mvn test -Dtest=TestMiniTezCliDriver -Dqfile=explainuser_3.q // original behavior is to create FMSketch func = parameters[1] == null ? "fm" : PrimitiveObjectInspectorUtils.getString( parameters[1], funcOI); if (parameters.length == 3) { numVectors = parameters[2] == null ? 0 : PrimitiveObjectInspectorUtils.getInt( parameters[2], numVectorsOI); if (numVectors > MAX_BIT_VECTORS) { throw new HiveException("The maximum allowed value for number of bit vectors " + " is " + MAX_BIT_VECTORS + ", but was passed " + numVectors + " bit vectors"); } } myagg.initNDVEstimator(func, numVectors); } // Update null counter if a null value is seen if (parameters[0] == null) { myagg.countNulls++; } else { myagg.update(parameters[0], inputOI); } }