@Override
  public void analyzeInternal(ASTNode root) throws SemanticException {
    if (root.getChildCount() < 1 || root.getChildCount() > 2) {
      throw new SemanticException("Incorrect syntax");
    }

    String resourcePlanName = unescapeIdentifier(root.getChild(0).getText());
    String destinationResourcePlan = root.getChildCount() == 2 ? unescapeIdentifier(root.getChild(1).getText()) : null;

    AlterResourcePlanReplaceDesc desc = new AlterResourcePlanReplaceDesc(resourcePlanName, destinationResourcePlan);
    Task<DDLWork> task = TaskFactory.get(new DDLWork(getInputs(), getOutputs(), desc));
    rootTasks.add(task);

    DDLUtils.addServiceOutput(conf, getOutputs());
  }
Analyzer for replace resource plan commands.
ql/src/java/org/apache/hadoop/hive/ql/ddl/workloadmanagement/resourceplan/alter/replace/AlterResourcePlanReplaceAnalyzer.java