public static void configureJobConf(TableDesc tableDesc, JobConf jobConf) {
    try {
      HiveStorageHandler storageHandler = HiveUtils.getStorageHandler(
          jobConf, tableDesc.getProperties().getProperty(hive_metastoreConstants.META_TABLE_STORAGE));
      if (storageHandler != null) {
        storageHandler.configureJobConf(tableDesc, jobConf);
      }
      if (tableDesc.getJobSecrets() != null) {
        for (Map.Entry<String, String> entry : tableDesc.getJobSecrets().entrySet()) {
          String key = TableDesc.SECRET_PREFIX + TableDesc.SECRET_DELIMIT +
                  tableDesc.getTableName() + TableDesc.SECRET_DELIMIT + entry.getKey();
          jobConf.getCredentials().addSecretKey(new Text(key), entry.getValue().getBytes());
        }
        tableDesc.getJobSecrets().clear();
      }
    } catch (HiveException e) {
      throw new RuntimeException(e);
    }
  }
Loads the storage handler (if one exists) for the given table
and invokes {@link HiveStorageHandler#configureOutputJobProperties(TableDesc, java.util.Map)}.

@param tableDesc table descriptor
ql/src/java/org/apache/hadoop/hive/ql/plan/PlanUtils.java