private void removeStatsTasks(List<Task<?>> rootTasks) {
    List<Task<?>> statsTasks = findStatsTasks(rootTasks, null);
    if (statsTasks == null) {
      return;
    }
    for (Task<?> statsTask : statsTasks) {
      if (statsTask.getParentTasks() == null) {
        continue; //should never happen
      }
      for (Task<?> t : new ArrayList<>(statsTask.getParentTasks())) {
        t.removeDependentTask(statsTask);
      }
    }
  }
Makes the exportTask run after all other tasks of the "insert into T ..." are done.
ql/src/java/org/apache/hadoop/hive/ql/parse/AcidExportSemanticAnalyzer.java