Examples of WindowFrameDef


Examples of org.apache.hadoop.hive.ql.plan.ptf.WindowFrameDef

    int precedingSpan = 0;
    int followingSpan = 0;

    for (int i = 0; i < tabDef.getWindowFunctions().size(); i++) {
      WindowFunctionDef wFnDef = tabDef.getWindowFunctions().get(i);
      WindowFrameDef wdwFrame = wFnDef.getWindowFrame();
      GenericUDAFEvaluator fnEval = wFnDef.getWFnEval();
      boolean streamingPossible = streamingPossible(cfg, wFnDef);
      GenericUDAFEvaluator streamingEval = streamingPossible ? fnEval
          .getWindowingEvaluator(wdwFrame) : null;
      if (streamingEval != null
          && streamingEval instanceof ISupportStreamingModeForWindowing) {
        continue;
      }
      BoundaryDef start = wdwFrame.getStart();
      BoundaryDef end = wdwFrame.getEnd();
      if (!(end instanceof ValueBoundaryDef)
          && !(start instanceof ValueBoundaryDef)) {
        if (end.getAmt() != BoundarySpec.UNBOUNDED_AMOUNT
            && start.getAmt() != BoundarySpec.UNBOUNDED_AMOUNT
            && end.getDirection() != Direction.PRECEDING
            && start.getDirection() != Direction.FOLLOWING) {

          int amt = wdwFrame.getStart().getAmt();
          if (amt > precedingSpan) {
            precedingSpan = amt;
          }

          amt = wdwFrame.getEnd().getAmt();
          if (amt > followingSpan) {
            followingSpan = amt;
          }
          continue;
        }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.plan.ptf.WindowFrameDef

    WindowTableFunctionDef tabDef = (WindowTableFunctionDef) getTableDef();

    for (int i = 0; i < tabDef.getWindowFunctions().size(); i++) {
      WindowFunctionDef wFnDef = tabDef.getWindowFunctions().get(i);
      WindowFrameDef wdwFrame = wFnDef.getWindowFrame();
      GenericUDAFEvaluator fnEval = wFnDef.getWFnEval();
      GenericUDAFEvaluator streamingEval = fnEval
          .getWindowingEvaluator(wdwFrame);
      if (streamingEval != null) {
        wFnDef.setWFnEval(streamingEval);
View Full Code Here

Examples of org.apache.hadoop.hive.ql.plan.ptf.WindowFrameDef

import org.junit.Test;

public class TestStreamingSum {

  public static WindowFrameDef wdwFrame(int p, int f) {
    WindowFrameDef wFrmDef = new WindowFrameDef();
    BoundaryDef start, end;
    if (p == 0) {
      start = new CurrentRowDef();
    } else {
      RangeBoundaryDef startR = new RangeBoundaryDef();
      startR.setDirection(Direction.PRECEDING);
      startR.setAmt(p);
      start = startR;
    }

    if (f == 0) {
      end = new CurrentRowDef();
    } else {
      RangeBoundaryDef endR = new RangeBoundaryDef();
      endR.setDirection(Direction.FOLLOWING);
      endR.setAmt(f);
      end = endR;
    }
    wFrmDef.setStart(start);
    wFrmDef.setEnd(end);
    return wFrmDef;
  }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.plan.ptf.WindowFrameDef

          initialize(arg, inpShape);
        }

      }
      if (wFnDef.getWindowFrame() != null) {
        WindowFrameDef wFrmDef = wFnDef.getWindowFrame();
        initialize(wFrmDef.getStart(), inpShape);
        initialize(wFrmDef.getEnd(), inpShape);
      }
      setupWdwFnEvaluator(wFnDef);
    }
    ArrayList<String> aliases = new ArrayList<String>();
    ArrayList<ObjectInspector> fieldOIs = new ArrayList<ObjectInspector>();
View Full Code Here

Examples of org.apache.hadoop.hive.ql.plan.ptf.WindowFrameDef

    WindowSpec wdwSpec = spec.getWindowSpec();
    if (wdwSpec != null) {
      String desc = spec.toString();

      WindowFrameDef wdwFrame = translate(spec.getName(), inpShape, wdwSpec);
      if (!wFnInfo.isSupportsWindow())
      {
        BoundarySpec start = wdwSpec.getWindowFrame().getStart();
        if (start.getAmt() != BoundarySpec.UNBOUNDED_AMOUNT) {
          throw new SemanticException(
View Full Code Here

Examples of org.apache.hadoop.hive.ql.plan.ptf.WindowFrameDef

    if (cmp > 0) {
      throw new SemanticException(String.format(
          "Window range invalid, start boundary is greater than end boundary: %s", spec));
    }

    WindowFrameDef wfDef = new WindowFrameDef();
    wfDef.setStart(translate(inpShape, s));
    wfDef.setEnd(translate(inpShape, e));
    return wfDef;
  }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.plan.ptf.WindowFrameDef

    WindowSpec wdwSpec = spec.getWindowSpec();
    if (wdwSpec != null) {
      String desc = spec.toString();

      WindowFrameDef wdwFrame = translate(spec.getName(), inpShape, wdwSpec);
      if (!wFnInfo.isSupportsWindow())
      {
        BoundarySpec start = wdwSpec.getWindowFrame().getStart();
        if (start.getAmt() != BoundarySpec.UNBOUNDED_AMOUNT) {
          throw new SemanticException(
View Full Code Here

Examples of org.apache.hadoop.hive.ql.plan.ptf.WindowFrameDef

    if (cmp > 0) {
      throw new SemanticException(String.format(
          "Window range invalid, start boundary is greater than end boundary: %s", spec));
    }

    WindowFrameDef wfDef = new WindowFrameDef();
    wfDef.setStart(translate(inpShape, s));
    wfDef.setEnd(translate(inpShape, e));
    return wfDef;
  }
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.