Package com.sap.hadoop.windowing

Examples of com.sap.hadoop.windowing.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());
View Full Code Here


      return new OrderDef(pDef);
    }
   
    if ( pDef == null )
    {
      throw new WindowingException(sprintf("Input %s cannot have an Order spec w/o a Partition spec", inputDesc));
    }
   
    OrderDef oDef = new OrderDef(spec);
    for(OrderColumnSpec colSpec : spec.getColumns())
    {
      OrderColumnDef cDef = translateOrderColumn(qDef, iInfo, colSpec);
      oDef.addColumn(cDef);
    }
   
    /*
     * either all partition columns must be in Order list or none must be specified.
     * If none are specified then add them all.
     */
    int numOfPartColumns = 0;
    List<OrderColumnDef> orderCols = oDef.getColumns();
    List<ColumnDef> partCols = pDef.getColumns();
    int chkSize = partCols.size();
    chkSize = chkSize > orderCols.size() ? orderCols.size() : chkSize;
    for(int i=0; i < chkSize; i++)
    {
      if ( orderCols.get(i).getSpec().getColumnName().equals(partCols.get(i).getSpec().getColumnName()))
      {
        numOfPartColumns++;
      }
      else
        break;
    }
   
    if ( numOfPartColumns != 0 && numOfPartColumns != partCols.size())
    {
      throw new WindowingException(
          sprintf("For Input %s:n all partition columns must be in order clause or none should be specified",
              inputDesc)
          );
    }
   
View Full Code Here

  static void  translateColumn(QueryDef qDef, ColumnDef cDef, InputInfo iInfo, ColumnSpec cSpec) throws WindowingException
  {
    String colTabName = cSpec.getTableName();
    if colTabName != null && !colTabName.equals(iInfo.getAlias()))
    {
      throw new WindowingException(sprintf("Unknown Table Reference in column", cSpec));
    }
   
    ASTNode expr = TranslateUtils.buildASTNode(cSpec.getColumnName());
    ExprNodeDesc exprNode = TranslateUtils.buildExprNode(expr, iInfo.getTypeCheckCtx());
    ExprNodeEvaluator exprEval = WindowingExprNodeEvaluatorFactory.get(qDef.getTranslationInfo(), exprNode);
View Full Code Here

    wfDef.setEnd(translateBoundary(qDef, e, iInfo));
   
    int cmp = s.compareTo(e);
    if ( cmp > 0 )
    {
      throw new WindowingException(sprintf("Window range invalid, start boundary is greater than end boundary: %s", wfSpec));
    }
    return wfDef;
  }
View Full Code Here

    {
      CurrentRowSpec cBndSpec = (CurrentRowSpec) bndSpec;
      CurrentRowDef cbDef = new CurrentRowDef(cBndSpec);
      return cbDef;
    }
    throw new WindowingException("Unknown Boundary: " + bndSpec);
  }
View Full Code Here

TOP

Related Classes of com.sap.hadoop.windowing.WindowingException

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.