private BoundarySpec getWindowBound(RexWindowBound wb) {
    BoundarySpec boundarySpec;

    if (wb.isCurrentRow()) {
      boundarySpec = new BoundarySpec(Direction.CURRENT);
    } else {
      final Direction direction;
      final int amt;
      if (wb.isPreceding()) {
        direction = Direction.PRECEDING;
      } else {
        direction = Direction.FOLLOWING;
      }
      if (wb.isUnbounded()) {
        amt = BoundarySpec.UNBOUNDED_AMOUNT;
      } else {
        amt = RexLiteral.intValue(wb.getOffset());
      }

      boundarySpec = new BoundarySpec(direction, amt);
    }

    return boundarySpec;
  }
TODO: Handle 1) cast 2), Windowing Agg Call
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/ExprNodeConverter.java