@Override
  public int execute() throws HiveException, IOException {
    WMResourcePlan plan = new WMResourcePlan(desc.getResourcePlanName());
    if (desc.getQueryParallelism() != null) {
      plan.setQueryParallelism(desc.getQueryParallelism());
    }

    context.getDb().createResourcePlan(plan, desc.getCopyFromName(), desc.getIfNotExists());

    return 0;
  }
Operation process of creating a resource plan.
ql/src/java/org/apache/hadoop/hive/ql/ddl/workloadmanagement/resourceplan/create/CreateResourcePlanOperation.java