Examples of OrderSpec


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

    this.spec = spec;
  }
 
  public OrderDef(PartitionDef pDef)
  {
    this.spec = new OrderSpec(pDef.getSpec());
    for(ColumnDef cDef : pDef.getColumns())
    {
      addColumn(new OrderColumnDef(cDef));
    }
  }
View Full Code Here

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

   
    fillInWindowSpec(qSpec, wSpec.getSourceId(), wSpec);
    wDef = new WindowDef(wSpec);
   
    PartitionSpec pSpec = wSpec.getPartition();
    OrderSpec oSpec = wSpec.getOrder();
    WindowFrameSpec wFrameSpec = wSpec.getWindow();
    PartitionDef pDef = translatePartition(qDef, iInfo, pSpec);
    OrderDef oDef = translateOrder(qDef, inputDesc, iInfo, oSpec, pDef);
    WindowFrameDef wdwDef = translateWindowFrame(qDef, wFrameSpec, iInfo);
   
View Full Code Here

Examples of de.fuberlin.wiwiss.d2rq.algebra.OrderSpec

    if (this.limitInverse!=null) {
      builder.setLimitInverse(this.limitInverse.intValue());
    }
    if (this.order!=null) {
      builder.setOrderSpecs(Collections.singletonList(
          new OrderSpec(new AttributeExpr(SQL.parseAttribute(this.order)), this.orderDesc.booleanValue())));
    }
    return builder.buildRelation();
  }
View Full Code Here

Examples of de.fuberlin.wiwiss.d2rq.algebra.OrderSpec

  }
 
  public List<OrderSpec> orderSpecs(boolean ascending) {
    List<OrderSpec> result = new ArrayList<OrderSpec>(columns.size());
    for (Attribute column: columns) {
      result.add(new OrderSpec(new AttributeExpr(column), ascending));
    }
    return result;
  }
View Full Code Here

Examples of de.fuberlin.wiwiss.d2rq.algebra.OrderSpec

    return new Column(renamer.applyTo(this.attribute));
  }
 
  public List<OrderSpec> orderSpecs(boolean ascending) {
    return Collections.singletonList(
        new OrderSpec(new AttributeExpr(attribute), ascending));
  }
View Full Code Here

Examples of de.fuberlin.wiwiss.d2rq.algebra.OrderSpec

  }
 
  public List<OrderSpec> orderSpecs(boolean ascending) {
    List<OrderSpec> result = new ArrayList<OrderSpec>(attributes.size());
    for (Attribute column: attributes) {
      result.add(new OrderSpec(new AttributeExpr(column), ascending));
    }
    return result;
  }
View Full Code Here

Examples of de.fuberlin.wiwiss.d2rq.algebra.OrderSpec

  public ValueMaker renameAttributes(ColumnRenamer renamer) {
    return new SQLExpressionValueMaker(renamer.applyTo(expression));
  }
 
  public List<OrderSpec> orderSpecs(boolean ascending) {
    return Collections.singletonList(new OrderSpec(expression, ascending));
  }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.parse.PTFInvocationSpec.OrderSpec

    }

    PartitionedTableFunctionSpec prevFn = (PartitionedTableFunctionSpec) ptfChain.pop();
    applyConstantPartition(prevFn);
    PartitionSpec partSpec = prevFn.getPartition();
    OrderSpec orderSpec = prevFn.getOrder();

    if (partSpec == null) {
      // oops this should have been caught before trying to componentize
      throw new SemanticException(
          "No Partitioning specification specified at start of a PTFChain");
    }
    if (orderSpec == null) {
      orderSpec = new OrderSpec(partSpec);
      prevFn.setOrder(orderSpec);
    }

    while (!ptfChain.isEmpty()) {
      PartitionedTableFunctionSpec currentFn = (PartitionedTableFunctionSpec) ptfChain.pop();
      String fnName = currentFn.getName();
      if (!FunctionRegistry.isTableFunction(fnName)) {
        throw new SemanticException(ErrorMsg.INVALID_FUNCTION.getMsg(fnName));
      }
      boolean transformsRawInput = FunctionRegistry.getTableFunctionResolver(fnName)
          .transformsRawInput();

      /*
       * if the current table function has no partition info specified: inherit it from the PTF up
       * the chain.
       */
      if (currentFn.getPartition() == null) {
        currentFn.setPartition(prevFn.getPartition());
        if (currentFn.getOrder() == null) {
          currentFn.setOrder(prevFn.getOrder());
        }
      }
      /*
       * If the current table function has no order info specified;
       */
      if (currentFn.getOrder() == null) {
        currentFn.setOrder(new OrderSpec(currentFn.getPartition()));
      }

      if (!currentFn.getPartition().equals(partSpec) ||
          !currentFn.getOrder().equals(orderSpec) ||
          transformsRawInput) {
View Full Code Here

Examples of org.apache.hadoop.hive.ql.parse.PTFInvocationSpec.OrderSpec

    }
    return pSpec;
  }

  private OrderSpec processOrderSpec(ASTNode sortNode) {
    OrderSpec oSpec = new OrderSpec();
    int exprCnt = sortNode.getChildCount();
    for(int i=0; i < exprCnt; i++) {
      OrderExpression exprSpec = new OrderExpression();
      exprSpec.setExpression((ASTNode) sortNode.getChild(i).getChild(0));
      if ( sortNode.getChild(i).getType() == HiveParser.TOK_TABSORTCOLNAMEASC ) {
        exprSpec.setOrder(org.apache.hadoop.hive.ql.parse.PTFInvocationSpec.Order.ASC);
      }
      else {
        exprSpec.setOrder(org.apache.hadoop.hive.ql.parse.PTFInvocationSpec.Order.DESC);
      }
      oSpec.addExpression(exprSpec);
    }
    return oSpec;
  }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.parse.PTFInvocationSpec.OrderSpec

      PartitionSpec pSpec = processPartitionSpec(firstChild);
      partitioning.setPartSpec(pSpec);
      ASTNode sortNode = pSpecNode.getChildCount() > 1 ? (ASTNode) pSpecNode.getChild(1) : null;
      if ( sortNode != null )
      {
        OrderSpec oSpec = processOrderSpec(sortNode);
        partitioning.setOrderSpec(oSpec);
      }
    }
    else if ( type == HiveParser.TOK_SORTBY || type == HiveParser.TOK_ORDERBY ) {
      ASTNode sortNode = firstChild;
      OrderSpec oSpec = processOrderSpec(sortNode);
      partitioning.setOrderSpec(oSpec);
    }
    return partitioning;
  }
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.