@Override
  public void analyzeInternal(ASTNode root) throws SemanticException {
    TableName tableName = getQualifiedTableName((ASTNode) root.getChild(0), MetaStoreUtils.getDefaultCatalog(conf));

    ASTNode command = (ASTNode)root.getChild(1);

    Map<String, String> partitionSpec = null;
    ASTNode partitionSpecNode = (ASTNode)root.getChild(2);
    if (partitionSpecNode != null) {
      //  We can use alter table partition rename to convert/normalize the legacy partition
      //  column values. In so, we should not enable the validation to the old partition spec
      //  passed in this command.
      if (command.getType() == HiveParser.TOK_ALTERTABLE_RENAMEPART) {
        partitionSpec = getPartSpec(partitionSpecNode);
      } else {
        if (command.getType() == HiveParser.TOK_ALTERTABLE_COMPACT) {
          HiveConf.setVar(conf, HiveConf.ConfVars.REWRITE_POLICY, Context.RewritePolicy.PARTITION.name());
        }
        partitionSpec = getValidatedPartSpec(getTable(tableName), partitionSpecNode, conf, false);
      }
    }

    analyzeCommand(tableName, partitionSpec, command);
  }
Abstract ancestor of all Alter Table analyzer, that have this structure:
tableName command partitionSpec?
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/AbstractAlterTableAnalyzer.java