public int executeInProcess() {
    // check the local work
    if (work == null) {
      return -1;
    }

    if (execContext == null) {
      execContext = new ExecMapperContext(job);
    }

    memoryMXBean = ManagementFactory.getMemoryMXBean();
    long startTime = System.currentTimeMillis();
    console.printInfo(Utilities.now()
        + "\tStarting to launch local task to process map join;\tmaximum memory = "
        + memoryMXBean.getHeapMemoryUsage().getMax());
    execContext.setJc(job);
    // set the local work, so all the operator can get this context
    execContext.setLocalWork(work);
    try {
      startForward(null);
      long currentTime = System.currentTimeMillis();
      long elapsed = currentTime - startTime;
      console.printInfo(Utilities.now() + "\tEnd of local task; Time Taken: "
          + Utilities.showTime(elapsed) + " sec.");
    } catch (Throwable throwable) {
      int retVal;
      String message;
      if (throwable instanceof OutOfMemoryError
          || (throwable instanceof MapJoinMemoryExhaustionError)) {
        message = "Hive Runtime Error: Map local work exhausted memory";
        retVal = 3;
      } else {
        message = "Hive Runtime Error: Map local work failed";
        retVal = 2;
      }
      l4j.error(message, throwable);
      console.printError(message, HiveStringUtils.stringifyException(throwable));
      return retVal;
    }
    return 0;
  }
MapredLocalTask represents any local work (i.e.: client side work) that hive needs to
execute. E.g.: This is used for generating Hashtables for Mapjoins on the client
before the Join is executed on the cluster.

MapRedLocalTask does not actually execute the work in process, but rather generates
a command using ExecDriver. ExecDriver is what will finally drive processing the records.
ql/src/java/org/apache/hadoop/hive/ql/exec/mr/MapredLocalTask.java