@Override
  public int execute() throws HiveException, IOException {
    // TODO: Enhance showResourcePlan to display all the pools, triggers and mappings.
    try (DataOutputStream out = ShowUtils.getOutputStream(new Path(desc.getResFile()), context)) {
      String resourcePlanName = desc.getResourcePlanName();
      ShowResourcePlanFormatter formatter = ShowResourcePlanFormatter.getFormatter(context.getConf());
      if (resourcePlanName != null) {
        formatter.showFullResourcePlan(out, context.getDb().getResourcePlan(resourcePlanName));
      } else {
        formatter.showResourcePlans(out, context.getDb().getAllResourcePlans());
      }
    }

    return 0;
  }
Operation process of showing resource plans.
ql/src/java/org/apache/hadoop/hive/ql/ddl/workloadmanagement/resourceplan/show/ShowResourcePlanOperation.java