@Override
  public int execute() {
    ScheduledQueryMaintenanceRequest request = buildScheduledQueryRequest();
    try {
      Hive.get().getMSC().scheduledQueryMaintenance(request);
      if (work.getScheduledQuery().isSetNextExecution()
          || request.getType() == ScheduledQueryMaintenanceRequestType.CREATE) {
        // we might have a scheduled query available for execution; immediately:
        // * in case a schedule is altered to be executed at a specific time
        // * in case we created a new scheduled query - for say run every second
        ScheduledQueryExecutionService.forceScheduleCheck();
      }
    } catch (TException | HiveException e) {
      setException(e);
      LOG.error("Failed", e);
      return 1;
    }
    return 0;
  }
Scheduled query maintenance task.

CREATES/ALTERS or DROPs a scheduled query.
ql/src/java/org/apache/hadoop/hive/ql/exec/schq/ScheduledQueryMaintenanceTask.java