Package org.apache.hadoop.hive.ql.parse.WindowingSpec

Examples of org.apache.hadoop.hive.ql.parse.WindowingSpec.WindowSpec


    if (FunctionRegistry.isRankingFunction(spec.getName())){
      setupRankingArgs(wdwTFnDef, def, spec);
    }

    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(
              String.format("Expecting left window frame boundary for " +
                  "function %s to be unbounded. Found : %d", desc, start.getAmt()));
        }
        BoundarySpec end = wdwSpec.getWindowFrame().getEnd();
        if (end.getAmt() != BoundarySpec.UNBOUNDED_AMOUNT) {
          throw new SemanticException(
              String.format("Expecting right window frame boundary for " +
                  "function %s to be unbounded. Found : %d", desc, start.getAmt()));
        }
View Full Code Here


    if (RANKING_FUNCS.contains(spec.getName()))
    {
      setupRankingArgs(wdwTFnDef, def, spec);
    }

    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(
          String.format("Expecting left window frame boundary for " +
              "function %s to be unbounded. Found : %d", desc, start.getAmt())
              );
        }
        BoundarySpec end = wdwSpec.getWindowFrame().getEnd();
        if ( end.getAmt() != BoundarySpec.UNBOUNDED_AMOUNT ) {
          throw new SemanticException(
              String.format("Expecting right window frame boundary for " +
              "function %s to be unbounded. Found : %d", desc, start.getAmt()));
        }
View Full Code Here

      ASTNode child = (ASTNode) node.getChild(i);
      wfSpec.addArg(child);
    }

    if ( wsNode != null ) {
      WindowSpec ws = processWindowSpec(wsNode);
      wfSpec.setWindowSpec(ws);
    }

    /*
     * In order to distinguish between different UDAF invocations on the same UDAF but different Windows
View Full Code Here

    if(spec.getWindowSpecs() != null && spec.getWindowSpecs().containsKey(nameNode.getText())){
      throw new SemanticException(generateErrorMessage(nameNode,
          "Duplicate definition of window " + nameNode.getText() +
          " is not allowed"));
    }
    WindowSpec ws = processWindowSpec(wsNode);
    spec.addWindowSpec(nameNode.getText(), ws);
  }
View Full Code Here

        hasWF = true; wfIdx = i;
        break;
      }
    }

    WindowSpec ws = new WindowSpec();

    if (hasSrcId) {
      ASTNode nameNode = (ASTNode) node.getChild(srcIdIdx);
      ws.setSourceId(nameNode.getText());
    }

    if (hasPartSpec) {
      ASTNode partNode = (ASTNode) node.getChild(partIdx);
      PartitioningSpec partitioning = processPTFPartitionSpec(partNode);
      ws.setPartitioning(partitioning);
    }

    if ( hasWF)
    {
      ASTNode wfNode = (ASTNode) node.getChild(wfIdx);
      WindowFrameSpec wfSpec = processWindowFrame(wfNode);
      ws.setWindowFrame(wfSpec);
    }

    return ws;
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hive.ql.parse.WindowingSpec.WindowSpec

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.