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

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


      boolean processWindow = processWindow(wFn);
      pItr.reset();
      if ( !processWindow ) {
        GenericUDAFEvaluator fEval = wFn.getWFnEval();
        Object[] args = new Object[wFn.getArgs() == null ? 0 : wFn.getArgs().size()];
        AggregationBuffer aggBuffer = fEval.getNewAggregationBuffer();
        while(pItr.hasNext()) {
          Object row = pItr.next();
          int i =0;
          if ( wFn.getArgs() != null ) {
            for(PTFExpressionDef arg : wFn.getArgs()) {
View Full Code Here


    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

      }

      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

  Object evaluateWindowFunction(WindowFunctionDef wFn,
      PTFPartitionIterator<Object> pItr) throws HiveException {
    GenericUDAFEvaluator fEval = wFn.getWFnEval();
    Object[] args = new Object[wFn.getArgs() == null ? 0 : wFn.getArgs().size()];
    AggregationBuffer aggBuffer = fEval.getNewAggregationBuffer();
    while(pItr.hasNext())
    {
      Object row = pItr.next();
      int i =0;
      if ( wFn.getArgs() != null ) {
View Full Code Here

      throw new UnsupportedOperationException();
    }

    @Override
    public AggregationBuffer getNewAggregationBuffer() throws HiveException {
      AggregationBuffer underlying = wrappedEval.getNewAggregationBuffer();
      return new State(numPreceding, numFollowing, underlying);
    }
View Full Code Here

      throws HiveException {

    GenericUDAFEvaluator fn = fnR.getEvaluator(inputTypes);
    fn.init(Mode.COMPLETE, inputOIs);
    fn = fn.getWindowingEvaluator(wdwFrame(numPreceding, numFollowing));
    AggregationBuffer agg = fn.getNewAggregationBuffer();
    ISupportStreamingModeForWindowing oS = (ISupportStreamingModeForWindowing) fn;

    int outSz = 0;
    while (inVals.hasNext()) {
      typeHandler.set(inVals.next(), in[0]);
View Full Code Here

      super(wrappedEval, numPreceding, numFollowing);
    }

    @Override
    public AggregationBuffer getNewAggregationBuffer() throws HiveException {
      AggregationBuffer underlying = wrappedEval.getNewAggregationBuffer();
      return new State(numPreceding, numFollowing, underlying);
    }
View Full Code Here

    // fields in these aggregation classes.
    estimableAggregationEvaluators = new boolean[aggregationEvaluators.length];
    for (int i = 0; i < aggregationEvaluators.length; i++) {

      fixedRowSize += javaObjectOverHead;
      AggregationBuffer agg = aggregationEvaluators[i].getNewAggregationBuffer();
      if (GenericUDAFEvaluator.isEstimable(agg)) {
        estimableAggregationEvaluators[i] = true;
        continue;
      }
      Field[] fArr = ObjectInspectorUtils.getDeclaredNonStaticFields(agg.getClass());
      for (Field f : fArr) {
        fixedRowSize += getSize(i, f.getType(), f);
      }
    }
  }
View Full Code Here

        }
      }

      AggregationBuffer[] aggs = hashAggregations.get(newKeys);
      for (int i = 0; i < aggs.length; i++) {
        AggregationBuffer agg = aggs[i];
        if (estimableAggregationEvaluators[i]) {
          totalVariableSize += ((GenericUDAFEvaluator.AbstractAggregationBuffer)agg).estimate();
          continue;
        }
        if (aggrPositions[i] != null) {
View Full Code Here

      throw new UnsupportedOperationException();
    }

    @Override
    public AggregationBuffer getNewAggregationBuffer() throws HiveException {
      AggregationBuffer underlying = wrappedEval.getNewAggregationBuffer();
      return new State(numPreceding, numFollowing, underlying);
    }
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.