private BoundarySpec processBoundary(ASTNode node)  throws SemanticException {
    BoundarySpec bs = new BoundarySpec();
    int type = node.getType();
    boolean hasAmt = true;

    switch(type)
    {
    case HiveParser.KW_PRECEDING:
      bs.setDirection(Direction.PRECEDING);
      break;
    case HiveParser.KW_FOLLOWING:
      bs.setDirection(Direction.FOLLOWING);
      break;
    case HiveParser.KW_CURRENT:
      bs.setDirection(Direction.CURRENT);
      hasAmt = false;
      break;
    default:
      // no-op
    }

    if ( hasAmt )
    {
      ASTNode amtNode = (ASTNode) node.getChild(0);
      if ( amtNode.getType() == HiveParser.KW_UNBOUNDED)
      {
        bs.setAmt(BoundarySpec.UNBOUNDED_AMOUNT);
      }
      else
      {
        int amt = Integer.parseInt(amtNode.getText());
        if ( amt < 0 ) {
          throw new SemanticException(
              "Window Frame Boundary Amount must be a non-negative integer, provided amount is: " + amt);
        } else if (amt == 0) {
          // Convert 0 PRECEDING/FOLLOWING to CURRENT ROW
          LOG.info("Converting 0 {} to CURRENT ROW", bs.getDirection());
          bs.setDirection(Direction.CURRENT);
          hasAmt = false;
        } else {
          bs.setAmt(amt);
        }
      }
    }

    return bs;
  }
It will check if this is analyze ... compute statistics noscan
@param tree
ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java