@Override
  public void analyzeInternal(ASTNode root) throws SemanticException {
    String resourcePlanName = unescapeIdentifier(root.getChild(0).getText());

    Integer queryParallelism = null;
    String defaultPool = null;
    for (int i = 1; i < root.getChildCount(); ++i) {
      Tree child = root.getChild(i);
      switch (child.getType()) {
      case HiveParser.TOK_QUERY_PARALLELISM:
        if (child.getChildCount() != 1) {
          throw new SemanticException("Expected one argument");
        }

        queryParallelism = Integer.parseInt(child.getChild(0).getText());
        break;
      case HiveParser.TOK_DEFAULT_POOL:
        if (child.getChildCount() != 1) {
          throw new SemanticException("Expected one argument");
        }

        defaultPool = WMUtils.poolPath(child.getChild(0));
        break;
      default:
        throw new SemanticException("Unexpected token in alter resource plan statement: " + child.getType());
      }
    }

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

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