@Override
  protected void analyzeCommand(TableName tableName, Map<String, String> partitionSpec, ASTNode command)
      throws SemanticException {
    Table table = getTable(tableName);
    // the first child must be the execute operation type
    ASTNode executeCommandType = (ASTNode) command.getChild(0);
    validateAlterTableType(table, AlterTableType.EXECUTE, false);
    inputs.add(new ReadEntity(table));
    AlterTableExecuteDesc desc = null;
    switch (executeCommandType.getType()) {
      case HiveParser.KW_ROLLBACK:
        desc = getRollbackDesc(tableName, partitionSpec, (ASTNode) command.getChild(1));
        break;
      case HiveParser.KW_EXPIRE_SNAPSHOTS:
        desc = getExpireSnapshotDesc(tableName, partitionSpec,  command.getChildren(), queryState.getConf());
        break;
      case HiveParser.KW_SET_CURRENT_SNAPSHOT:
        desc = getSetCurrentSnapshotDesc(tableName, partitionSpec, (ASTNode) command.getChild(1));
        break;
      case HiveParser.KW_FAST_FORWARD:
        desc = getFastForwardDesc(tableName, partitionSpec, command);
        break;
      case HiveParser.KW_CHERRY_PICK:
        desc = getCherryPickDesc(tableName, partitionSpec, (ASTNode) command.getChild(1));
        break;
      case HiveParser.KW_ORPHAN_FILES:
        desc = getDeleteOrphanFilesDesc(tableName, partitionSpec,  command.getChildren());
        break;
    }

    rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), desc)));
  }
Analyzer for ALTER TABLE ... EXECUTE commands.
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/execute/AlterTableExecuteAnalyzer.java