@Override
  protected void analyzeCommand(TableName tableName, Map<String, String> partitionSpec, ASTNode command)
      throws SemanticException {
    Table table = getTable(tableName);
    // the first child must be the addprops operation type
    validateAlterTableType(table, AlterTableType.ADDPROPS, false);
    inputs.add(new ReadEntity(table));
    ASTNode targetType = (ASTNode) command.getChild(0);
    Map<String, String> properties = new HashMap<>();
    if (command.getChildCount() == 2) {
      properties = getProps((ASTNode) (command.getChild(1)).getChild(0));
    }
    AlterTableConvertSpec spec = new AlterTableConvertSpec(targetType.getText(), properties);
    AlterTableConvertDesc desc = new AlterTableConvertDesc(tableName, spec);

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