public static Map<String, String>
  getInputJobProperties(HiveStorageHandler storageHandler,
      InputJobInfo inputJobInfo) {
    Properties props = inputJobInfo.getTableInfo().getStorerInfo().getProperties();
    props.put(serdeConstants.SERIALIZATION_LIB,storageHandler.getSerDeClass().getName());
    TableDesc tableDesc = new TableDesc(storageHandler.getInputFormatClass(),
      storageHandler.getOutputFormatClass(),props);
    if (tableDesc.getJobProperties() == null) {
      tableDesc.setJobProperties(new HashMap<String, String>());
    }

    Properties mytableProperties = tableDesc.getProperties();
    mytableProperties.setProperty(org.apache.hadoop.hive.metastore.api.hive_metastoreConstants.META_TABLE_NAME,inputJobInfo.getDatabaseName()+ "." + inputJobInfo.getTableName());

    Map<String, String> jobProperties = new HashMap<String, String>();
    try {

      Map<String, String> properties = tableDesc.getJobProperties();
      LinkedList<InputJobInfo> inputJobInfos = (LinkedList<InputJobInfo>) HCatUtil.deserialize(
              properties.get(HCatConstants.HCAT_KEY_JOB_INFO));
      if (inputJobInfos == null) {
        inputJobInfos = new LinkedList<>();
      }
      inputJobInfos.add(inputJobInfo);
      properties.put(HCatConstants.HCAT_KEY_JOB_INFO, HCatUtil.serialize(inputJobInfos));

      storageHandler.configureInputJobProperties(tableDesc, jobProperties);

    } catch (IOException e) {
      throw new IllegalStateException(
        "Failed to configure StorageHandler", e);
    }

    return jobProperties;
  }
Create an instance of a storage handler. If storageHandler == null,
then surrrogate StorageHandler is used to encapsulate the InputFormat, OutputFormat and SerDe.
This StorageHandler assumes the other supplied storage artifacts are for a file-based storage system.
@param conf job's configuration will be used to configure the Configurable StorageHandler
@param storageHandler fully qualified class name of the desired StorageHandle instance
@param serDe fully qualified class name of the desired SerDe instance
@param inputFormat fully qualified class name of the desired InputFormat instance
@param outputFormat fully qualified class name of the desired outputFormat instance
@return storageHandler instance
@throws IOException
hcatalog/core/src/main/java/org/apache/hive/hcatalog/common/HCatUtil.java