Examples of WindowSpec


Examples of com.odiago.flumebase.parser.WindowSpec

    super.visit(e);
  }

  @Override
  protected void visit(WindowDef e) throws VisitException {
    WindowSpec spec = e.getWindowSpec();
    if (mOldChild == spec) {
      e.setWindowSpec((WindowSpec) mNewChild);
    }

    super.visit(e);
View Full Code Here

Examples of com.odiago.flumebase.parser.WindowSpec

  protected void visit(AllFieldsExpr e) throws VisitException {
    // Nothing to do.
  }

  protected void visit(WindowDef def) throws VisitException {
    WindowSpec spec = def.getWindowSpec();
    spec.accept(this);
  }
View Full Code Here

Examples of com.sap.hadoop.windowing.query2.specification.WindowSpec

    throw new WindowingException("No Order by specification on Function: " + tblFnDef.getSpec());
  }
 
  public static WindowDef translateWindowSpec(QueryDef qDef, InputInfo iInfo, WindowFunctionSpec wFnSpec) throws WindowingException
  {
    WindowSpec wSpec = wFnSpec.getWindowSpec();
   
    if ( wSpec == null ) return null;
   
    WindowFunctionInfo wFnInfo = FunctionRegistry.getWindowFunctionInfo(wFnSpec.getName());
    String desc = wFnSpec.toString();
View Full Code Here

Examples of com.sap.hadoop.windowing.query2.specification.WindowSpec

   
    /*
     * for now the Language only allows explicit specification of Partition & Order clauses.
     * Easy to allow references to a Global Window Spec.
     */
    WindowSpec wSpec = new WindowSpec();
    wSpec.setPartition(tFnSpec.getPartition());
    wSpec.setOrder(tFnSpec.getOrder());
    QueryInputDef iDef = tFnDef.getInput();
   
    if ( wSpec.getPartition() == null )
    {
      return null;
    }
   
    String desc = getInputDescription(qDef, tFnDef);
View Full Code Here

Examples of com.sap.hadoop.windowing.query2.specification.WindowSpec

 
  static void fillInWindowSpec(QuerySpec qSpec, String sourceId, WindowSpec destWSpec) throws WindowingException
  {
    if ( sourceId != null )
    {
      WindowSpec sourceWSpec = qSpec.getWindowSpecs().get(sourceId);
      if (sourceWSpec == null)
      {
        throw new WindowingException(sprintf("Window Spec %s refers to an unknown source", destWSpec));
      }
     
      if ( destWSpec.getPartition() == null )
      {
        destWSpec.setPartition(sourceWSpec.getPartition());
      }
     
      if ( destWSpec.getOrder() == null )
      {
        destWSpec.setOrder(sourceWSpec.getOrder());
      }
     
      if ( destWSpec.getWindow() == null)
      {
        destWSpec.setWindow(sourceWSpec.getWindow());
      }
     
      fillInWindowSpec(qSpec, sourceWSpec.getSourceId(), destWSpec);
    }
  }
View Full Code Here

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

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

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

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

    return wfSpec;
  }
View Full Code Here

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

    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

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

        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

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

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

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

    return wfSpec;
  }
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.