if (dynamicPartVals != null) {
// dynamic part vals specified
List<String> dynamicPartKeys = jobInfo.getDynamicPartitioningKeys();
if (dynamicPartVals.size() != dynamicPartKeys.size()) {
throw new HCatException(ErrorType.ERROR_INVALID_PARTITION_VALUES,
"Unable to configure dynamic partitioning for storage handler, mismatch between"
+ " number of partition values obtained[" + dynamicPartVals.size()
+ "] and number of partition values required[" + dynamicPartKeys.size() + "]");
}
for (int i = 0; i < dynamicPartKeys.size(); i++) {
partitionValues.put(dynamicPartKeys.get(i), dynamicPartVals.get(i));
}
// // re-home location, now that we know the rest of the partvals
// Table table = jobInfo.getTableInfo().getTable();
//
// List<String> partitionCols = new ArrayList<String>();
// for(FieldSchema schema : table.getPartitionKeys()) {
// partitionCols.add(schema.getName());
// }
jobInfo.setPartitionValues(partitionValues);
}
HCatUtil.configureOutputStorageHandler(storageHandler, conf, jobInfo);
} catch (Exception e) {
if (e instanceof HCatException) {
throw (HCatException) e;
} else {
throw new HCatException(ErrorType.ERROR_INIT_STORAGE_HANDLER, e);
}
}
}