@Override
  protected void setInputFormat(Task<?> task) {
    if (task instanceof TezTask) {
      TezWork work = ((TezTask)task).getWork();
      List<BaseWork> all = work.getAllWork();
      for (BaseWork w: all) {
        if (w instanceof MergeJoinWork) {
          MergeJoinWork mj = (MergeJoinWork)w;
          setInputFormatForMapWork(mj.getMainWork());
          for (BaseWork bw : mj.getBaseWorkList()) {
            setInputFormatForMapWork(bw);
          }
        } else {
          setInputFormatForMapWork(w);
        }
      }
    } else if (task instanceof ConditionalTask) {
      List<Task<?>> listTasks
        = ((ConditionalTask) task).getListTasks();
      for (Task<?> tsk : listTasks) {
        setInputFormat(tsk);
      }
    }

    if (task.getChildTasks() != null) {
      for (Task<?> childTask : task.getChildTasks()) {
        setInputFormat(childTask);
      }
    }
  }
TezCompiler translates the operator plan into TezTasks.
ql/src/java/org/apache/hadoop/hive/ql/parse/TezCompiler.java