@Override
  public void analyzeInternal(ASTNode root) throws SemanticException {
    TableName viewName = getQualifiedTableName((ASTNode) root.getChild(0));
    String fqViewName = viewName.getNotEmptyDbTable();
    LOG.info("Altering the query of view " + fqViewName + " position=" + root.getCharPositionInLine());

    ASTNode select = (ASTNode) root.getChild(1).getChild(0);

    String originalText = ctx.getTokenRewriteStream().toString(select.getTokenStartIndex(), select.getTokenStopIndex());

    SemanticAnalyzer analyzer = analyzeQuery(select, fqViewName);

    schema = new ArrayList<FieldSchema>(analyzer.getResultSchema());
    ParseUtils.validateColumnNameUniqueness(
        analyzer.getOriginalResultSchema() == null ? schema : analyzer.getOriginalResultSchema());
    setColumnAccessInfo(analyzer.getColumnAccessInfo());
    String expandedText = ctx.getTokenRewriteStream().toString(select.getTokenStartIndex(), select.getTokenStopIndex());

    AlterViewAsDesc desc = new AlterViewAsDesc(fqViewName, schema, originalText, expandedText);
    validateCreateView(desc, analyzer);

    rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), desc)));
    DDLUtils.addDbAndTableToOutputs(getDatabase(viewName.getDb()), viewName, TableType.VIRTUAL_VIEW, false,
        null, outputs);
  }
Analyzer for alter view ... as commands.
ql/src/java/org/apache/hadoop/hive/ql/ddl/view/create/AlterViewAsAnalyzer.java