@Override
  public void analyzeInternal(ASTNode root) throws SemanticException {
    if (root.getChildCount() > 1) {
      throw new SemanticException("Invalid syntax for SHOW RESOURCE PLAN statement");
    }

    ctx.setResFile(ctx.getLocalTmpPath());

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

    ShowResourcePlanDesc desc = new ShowResourcePlanDesc(resourcePlanName, ctx.getResFile().toString());
    Task<DDLWork> task = TaskFactory.get(new DDLWork(getInputs(), getOutputs(), desc));
    rootTasks.add(task);

    task.setFetchSource(true);
    setFetchTask(createFetchTask(desc.getSchema()));

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