// Populate jobProperties with input table name, table columns, RM snapshot,
// hbase-default.xml and hbase-site.xml
Map<String, String> tableJobProperties = tableDesc.getJobProperties();
String jobString = tableJobProperties.get(HCatConstants.HCAT_KEY_JOB_INFO);
try {
InputJobInfo inputJobInfo = (InputJobInfo) HCatUtil.deserialize(jobString);
HCatTableInfo tableInfo = inputJobInfo.getTableInfo();
String qualifiedTableName = HBaseHCatStorageHandler.getFullyQualifiedHBaseTableName(tableInfo);
jobProperties.put(TableInputFormat.INPUT_TABLE, qualifiedTableName);
Configuration jobConf = getJobConf();
addHbaseResources(jobConf, jobProperties);
JobConf copyOfConf = new JobConf(jobConf);
HBaseConfiguration.addHbaseResources(copyOfConf);
//Getting hbase delegation token in getInputSplits does not work with PIG. So need to
//do it here
if (jobConf instanceof JobConf) { //Should be the case
HBaseUtil.addHBaseDelegationToken(copyOfConf);
((JobConf)jobConf).getCredentials().addAll(copyOfConf.getCredentials());
}
String outputSchema = jobConf.get(HCatConstants.HCAT_KEY_OUTPUT_SCHEMA);
jobProperties.put(TableInputFormat.SCAN_COLUMNS, getScanColumns(tableInfo, outputSchema));
String serSnapshot = (String) inputJobInfo.getProperties().get(
HBaseConstants.PROPERTY_TABLE_SNAPSHOT_KEY);
if (serSnapshot == null) {
HCatTableSnapshot snapshot = HBaseRevisionManagerUtil.createSnapshot(copyOfConf,
qualifiedTableName, tableInfo);
jobProperties.put(HBaseConstants.PROPERTY_TABLE_SNAPSHOT_KEY,