private WindowFunctionSpec processWindowFunction(ASTNode node, ASTNode wsNode)
      throws SemanticException {
    WindowFunctionSpec wfSpec = new WindowFunctionSpec();

    switch(node.getType()) {
    case HiveParser.TOK_FUNCTIONSTAR:
      wfSpec.setStar(true);
      break;
    case HiveParser.TOK_FUNCTIONDI:
      wfSpec.setDistinct(true);
      break;
    }

    wfSpec.setExpression(node);

    ASTNode nameNode = (ASTNode) node.getChild(0);
    wfSpec.setName(nameNode.getText());

    for(int i=1; i < node.getChildCount()-1; i++) {
      ASTNode child = (ASTNode) node.getChild(i);
      wfSpec.addArg(child);
    }

    if ( wsNode != null ) {
      WindowFunctionInfo functionInfo = FunctionRegistry.getWindowFunctionInfo(wfSpec.name);
      if (functionInfo == null) {
        throw new SemanticException(ErrorMsg.INVALID_FUNCTION.getMsg(wfSpec.name));
      }
      wfSpec.setRespectNulls(processRespectIgnoreNulls(functionInfo, wsNode));
      wfSpec.setWindowSpec(processWindowSpec(wsNode));
    }

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