public int executeTask(HiveHistory hiveHistory) {
    try {
      this.setStarted();
      if (hiveHistory != null) {
        hiveHistory.logPlanProgress(queryPlan);
      }

      if (conf != null) {
        LOG.debug("Task getting executed using mapred tag : " + conf.get(MRJobConfig.JOB_TAGS));
      }
      int retval = execute();
      this.setDone();
      if (hiveHistory != null) {
        hiveHistory.logPlanProgress(queryPlan);
      }
      return retval;
    } catch (IOException e) {
      throw new RuntimeException("Unexpected error: " + e.getMessage(), e);
    }
  }
This method is called in the Driver on every task. It updates counters and calls execute(),
which is overridden in each task

@return return value of execute()
ql/src/java/org/apache/hadoop/hive/ql/exec/Task.java