public JobConf createConfiguration(HiveConf hiveConf, boolean skipAMConf) throws IOException {
    hiveConf.setBoolean("mapred.mapper.new-api", false);

    Predicate<String> findDefaults =
        (s) -> ((s != null) && (s.endsWith(".xml") || (s.endsWith(".java") && !"HiveConf.java".equals(s))));

    // since this is an inclusion filter, negate the predicate
    JobConf conf =
        TezConfigurationFactory
            .wrapWithJobConf(hiveConf, skipAMConf ? findDefaults.negate() : null);

    if (conf.get("mapred.output.committer.class") == null) {
      conf.set("mapred.output.committer.class", NullOutputCommitter.class.getName());
    }

    conf.setBoolean("mapred.committer.job.setup.cleanup.needed", false);
    conf.setBoolean("mapred.committer.job.task.cleanup.needed", false);

    conf.setClass("mapred.output.format.class", HiveOutputFormatImpl.class, OutputFormat.class);

    conf.set(MRJobConfig.OUTPUT_KEY_CLASS, HiveKey.class.getName());
    conf.set(MRJobConfig.OUTPUT_VALUE_CLASS, BytesWritable.class.getName());

    conf.set("mapred.partitioner.class", HiveConf.getVar(conf, HiveConf.ConfVars.HIVE_PARTITIONER));
    conf.set("tez.runtime.partitioner.class", MRPartitioner.class.getName());

    // Removing job credential entry/ cannot be set on the tasks
    conf.unset("mapreduce.job.credentials.binary");

    // TODO: convert this to a predicate too
    hiveConf.stripHiddenConfigurations(conf);

    // Remove hive configs which are used only in HS2 and not needed for execution
    conf.unset(ConfVars.HIVE_AUTHORIZATION_SQL_STD_AUTH_CONFIG_WHITELIST.varname);
    return conf;
  }
Creates and initializes a JobConf object that can be used to execute
the DAG. This can skip the configs which are already included in AM configs.
@param hiveConf Current conf for the execution
@param skipAMConf Skip the configs where are already set across all DAGs
@return JobConf base configuration for job execution
@throws IOException
ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java