private String queueAsUser(UserGroupInformation ugi, final List<String> args,
                            final TempletonControllerJob controllerJob)
    throws IOException, InterruptedException {
    LOG.debug("Launching job: {}", args);
    return ugi.doAs(new PrivilegedExceptionAction<String>() {
      public String run() throws Exception {
        runTempletonControllerJob(controllerJob, args);
        return controllerJob.getSubmittedId();
      }
    });
  }
Enqueue the TempletonControllerJob directly calling doAs.
hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/LauncherDelegator.java