public static HiveConf getHiveConf(Configuration conf)
    throws IOException {

    HiveConf hiveConf = new HiveConf(conf, HCatUtil.class);

    //copy the hive conf into the job conf and restore it
    //in the backend context
    if (StringUtils.isBlank(conf.get(HCatConstants.HCAT_KEY_HIVE_CONF))) {
      // Called once on the client.
      LOG.info(HCatConstants.HCAT_KEY_HIVE_CONF + " not set. Generating configuration differences.");

      Properties differences = getHiveSiteOverrides(conf);

      // Must set this key even if differences is empty otherwise client and AM will attempt
      // to set this multiple times.
      conf.set(HCatConstants.HCAT_KEY_HIVE_CONF, HCatUtil.serialize(differences));
    } else {
      // Called one or more times on the client and AM.
      LOG.info(HCatConstants.HCAT_KEY_HIVE_CONF + " is set. Applying configuration differences.");

      Properties properties = (Properties) HCatUtil.deserialize(
          conf.get(HCatConstants.HCAT_KEY_HIVE_CONF));

      storePropertiesToHiveConf(properties, hiveConf);
    }

    if (conf.get(HCatConstants.HCAT_KEY_TOKEN_SIGNATURE) != null) {
      hiveConf.setVar(HiveConf.ConfVars.METASTORE_TOKEN_SIGNATURE,
        conf.get(HCatConstants.HCAT_KEY_TOKEN_SIGNATURE));
    }

    return hiveConf;
  }
Returns the hive-site.xml config settings which do not appear in <code>jobConf<code> or
the hive-site.xml config settings which appear in <code>jobConf<code>, but have a
different value than HiveConf code defaults.
@param hiveSite the config settings as found in the hive-site.xml only.
@param jobConf the config settings used to launch the job.
@return the set difference between hiveSite and jobConf.
hcatalog/core/src/main/java/org/apache/hive/hcatalog/common/HCatUtil.java