@Override
  public int execute() throws HiveException, IOException {
    WMNullableResourcePlan resourcePlan = new WMNullableResourcePlan();
    if (desc.getDestinationResourcePlanName() == null) {
      resourcePlan.setStatus(WMResourcePlanStatus.ACTIVE);
    } else {
      resourcePlan.setName(desc.getDestinationResourcePlanName());
    }

    WMFullResourcePlan appliedResourcePlan = context.getDb().alterResourcePlan(desc.getResourcePlanName(), resourcePlan,
        false, false, true);

    handleWMServiceChangeIfNeeded(appliedResourcePlan, false, false, true);
    return 0;
  }
Operation process of replacing a resource plan.
ql/src/java/org/apache/hadoop/hive/ql/ddl/workloadmanagement/resourceplan/alter/replace/AlterResourcePlanReplaceOperation.java