private OrderDef buildOrderExpressions(ShapeDetails inpShape, List<OrderExpression> orderExpressions)
      throws SemanticException {
    OrderDef orderDef = new OrderDef();
    for (OrderExpression oe : orderExpressions) {
      PTFTranslator.validateNoLeadLagInValueBoundarySpec(oe.getExpression());
      PTFExpressionDef exprDef = null;
      try {
        exprDef = buildExpressionDef(inpShape, oe.getExpression());
      } catch (HiveException he) {
        throw new SemanticException(he);
      }
      PTFTranslator.validateValueBoundaryExprType(exprDef.getOI());
      OrderExpressionDef orderExprDef = new OrderExpressionDef(exprDef);
      orderExprDef.setOrder(oe.getOrder());
      orderExprDef.setNullOrder(oe.getNullOrder());
      orderDef.addExpression(orderExprDef);
    }
    return orderDef;
  }
Collect order expressions for RANGE based windowing
@throws SemanticException
ql/src/java/org/apache/hadoop/hive/ql/parse/PTFTranslator.java