Package org.apache.hadoop.hive.ql.udf.generic.GenericUDAFEvaluator

Examples of org.apache.hadoop.hive.ql.udf.generic.GenericUDAFEvaluator.AggregationBuffer


    GenericUDAFEvaluator fEval = wFnDef.getWFnEval();

    Object[] args = new Object[wFnDef.getArgs() == null ? 0 : wFnDef.getArgs().size()];
    for(int i=0; i < iPart.size(); i++) {
      AggregationBuffer aggBuffer = fEval.getNewAggregationBuffer();
      Range rng = getRange(wFnDef, i, iPart, order);
      PTFPartitionIterator<Object> rItr = rng.iterator();
      PTFOperator.connectLeadLagFunctionsToPartition(ptfDesc, rItr);
      while(rItr.hasNext()) {
        Object row = rItr.next();
View Full Code Here


   
    Mode m = Mode.COMPLETE;
    ObjectInspector outputOi = udafEvaluator.init(m, inputOiList);
   
    Object[] parameters = new Object[] { null , 12 };
    AggregationBuffer agg = udafEvaluator.getNewAggregationBuffer();
    udafEvaluator.reset(agg);
    udafEvaluator.iterate(agg, parameters);
    Object result = udafEvaluator.terminate(agg);
   
    LOG.info("result = " + result);
View Full Code Here

    GenericUDAFParameterInfo paramInfo2 = new SimpleGenericUDAFParameterInfo(inputOiList2, false, false);
    GenericUDAFEvaluator udafEvaluator2 = udaf.getEvaluator(paramInfo2);
   
    Mode m1 = Mode.PARTIAL1;
    ObjectInspector partialOutputOi1 = udafEvaluator1.init(m1, inputOiList1);
    AggregationBuffer agg1 = udafEvaluator1.getNewAggregationBuffer();
    udafEvaluator1.reset(agg1);
    udafEvaluator1.iterate(agg1, new Object[] { null , 12 });
    Object res1 = udafEvaluator1.terminate(agg1);
   
    Mode m2 = Mode.PARTIAL1;
    ObjectInspector partialOutputOi2 = udafEvaluator2.init(m2, inputOiList2);
    AggregationBuffer agg2 = udafEvaluator2.getNewAggregationBuffer();
    udafEvaluator2.reset(agg2);
    udafEvaluator2.iterate(agg2, new Object[] { null , 12 });
    Object res2 = udafEvaluator2.terminate(agg2);
   
    ObjectInspector finalOutputOi = udafEvaluator2.init(Mode.FINAL, new ObjectInspector[] {partialOutputOi1});
   
    AggregationBuffer agg3 = udafEvaluator2.getNewAggregationBuffer();
    udafEvaluator2.merge(agg3, agg1);
    udafEvaluator2.merge(agg3, agg2);
   
    Object result = udafEvaluator2.terminate(agg3);
   
View Full Code Here

   
    Mode m = Mode.COMPLETE;
    ObjectInspector finalOutputOi = udafEvaluator.init(m, inputOiList);
   
    Object[] parameters = new Object[] { "foo" , 12 };
    AggregationBuffer agg = udafEvaluator.getNewAggregationBuffer();
    udafEvaluator.reset(agg);
    udafEvaluator.iterate(agg, parameters);
    Object result = udafEvaluator.terminate(agg);
   
    LOG.info("result = " + result);
View Full Code Here

    GenericUDAFEvaluator udafEvaluator = udaf.getEvaluator(paramInfo);
   
    Mode m = Mode.COMPLETE;
    ObjectInspector finalOutputOi = udafEvaluator.init(m, inputOiList);
   
    AggregationBuffer agg = udafEvaluator.getNewAggregationBuffer();
    udafEvaluator.reset(agg);
   
    String uuid;
    HashMap<String, Integer> h = new HashMap<String, Integer>();
    for (int i = 0; i < uniqueCount; i++) {
View Full Code Here

      }

      for (varLenFields v : aggrPositions) {
        int aggrPos = v.getAggrPos();
        List<Field> fieldsVarLen = v.getFields();
        AggregationBuffer agg = aggs[aggrPos];

        try {
          for (Field f : fieldsVarLen) {
            totalVariableSize += ((String) f.get(agg)).length();
          }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hive.ql.udf.generic.GenericUDAFEvaluator.AggregationBuffer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.