private static void configureJobPropertiesForStorageHandler(boolean input,
    TableDesc tableDesc) {

    if (tableDesc == null) {
      return;
    }

    try {
      HiveStorageHandler storageHandler = HiveUtils.getStorageHandler(
          SessionState.getSessionConf(), 
          tableDesc.getProperties().getProperty(hive_metastoreConstants.META_TABLE_STORAGE));
      if (storageHandler != null) {
        Map<String, String> jobProperties = new LinkedHashMap<>();
        Map<String, String> jobSecrets = new LinkedHashMap<>();
        if(input) {
            try {
                storageHandler.configureInputJobProperties(
                  tableDesc,
                  jobProperties);
            } catch(AbstractMethodError e) {
                LOG.info("configureInputJobProperties not found "+
                    "using configureTableJobProperties",e);
                storageHandler.configureTableJobProperties(tableDesc, jobProperties);
            }

            try{
              storageHandler.configureInputJobCredentials(
                tableDesc,
                jobSecrets);
            } catch(AbstractMethodError e) {
              // ignore
              LOG.info("configureInputJobSecrets not found");
            }
        }
        else {
            try {
                storageHandler.configureOutputJobProperties(
                  tableDesc,
                  jobProperties);
            } catch(AbstractMethodError e) {
                LOG.info("configureOutputJobProperties not found"+
                    "using configureTableJobProperties",e);
                storageHandler.configureTableJobProperties(tableDesc, jobProperties);
            }
        }
        // Job properties are only relevant for non-native tables, so
        // for native tables, leave it null to avoid cluttering up
        // plans.
        if (!jobProperties.isEmpty()) {
          tableDesc.setJobProperties(jobProperties);
        }

        // same idea, only set for non-native tables
        if (!jobSecrets.isEmpty()) {
          tableDesc.setJobSecrets(jobSecrets);
        }
      }
    } catch (HiveException ex) {
      throw new RuntimeException(ex);
    }
  }
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