Examples of ISupportStreamingModeForWindowing


Examples of org.apache.hadoop.hive.ql.udf.generic.ISupportStreamingModeForWindowing

        Object out = evaluateWindowFunction(wFn, pItr);
        output.add(out);
      } else if (wFn.isPivotResult()) {
        GenericUDAFEvaluator streamingEval = wFn.getWFnEval().getWindowingEvaluator(wFn.getWindowFrame());
        if ( streamingEval != null && streamingEval instanceof ISupportStreamingModeForWindowing ) {
          ISupportStreamingModeForWindowing strEval = (ISupportStreamingModeForWindowing) streamingEval;
          if ( strEval.getRowsRemainingAfterTerminate() == 0 ) {
            wFn.setWFnEval(streamingEval);
            if ( wFn.getOI() instanceof ListObjectInspector ) {
              ListObjectInspector listOI = (ListObjectInspector) wFn.getOI();
              wFn.setOI(listOI.getListElementObjectInspector());
            }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.udf.generic.ISupportStreamingModeForWindowing

    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]);
      fn.aggregate(agg, in);
      Object out = oS.getNextResult(agg);
      if (out != null) {
        if ( out == ISupportStreamingModeForWindowing.NULL_RESULT ) {
          out = null;
        } else {
          try {
            out = typeHandler.get((TW) out);
          } catch(ClassCastException ce) {
          }
        }
        Assert.assertEquals(out, outVals.next());
        outSz++;
      }
    }

    fn.terminate(agg);

    while (outSz < inSz) {
      Object out = oS.getNextResult(agg);
      if ( out == ISupportStreamingModeForWindowing.NULL_RESULT ) {
        out = null;
      } else {
        try {
          out = typeHandler.get((TW) out);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.