public static MapredContext init(boolean isMap, JobConf jobConf) {
    MapredContext context =
        HiveConf.getVar(jobConf, ConfVars.HIVE_EXECUTION_ENGINE).equals("tez") ?
            new TezContext(isMap, jobConf) : new MapredContext(isMap, jobConf);
    contexts.set(context);
    if (logger.isDebugEnabled()) {
      logger.debug("MapredContext initialized.");
    }
    return context;
  }
Runtime context of MapredTask providing additional information to GenericUDF
ql/src/java/org/apache/hadoop/hive/ql/exec/MapredContext.java