InputConf inputConf = new InputConf(conf, myProfileId);
LOG.info("getSplits for profile " + inputConf.getProfileId());
JobConf jobConf = new JobConf(conf);
InputInfo inputInfo = inputConf.readInputInfoFromConf();
int partitionNum = 0;
List<InputSplit> splits = Lists.newArrayList();
Iterable<InputPartition> partitions = inputInfo.getPartitions();
for (InputPartition inputPartition : partitions) {
org.apache.hadoop.mapred.InputFormat baseInputFormat =
inputPartition.makeInputFormat(conf);
HadoopUtils.setInputDir(jobConf, inputPartition.getLocation());
int splitsRequested = inputConf.readNumSplitsFromConf();
org.apache.hadoop.mapred.InputSplit[] baseSplits =
baseInputFormat.getSplits(jobConf, splitsRequested);
LOG.info("Requested " + splitsRequested + " from partition (" +
partitionNum + " out of " + Iterables.size(partitions) +
") values: " +
inputPartition.getInputSplitData().getPartitionValues() +
", got " + baseSplits.length + " splits");
for (org.apache.hadoop.mapred.InputSplit baseSplit : baseSplits) {
InputSplit split = new HiveApiInputSplit(baseInputFormat, baseSplit,
inputInfo.getTableSchema(), inputInfo.getColumnIds(),
inputPartition.getInputSplitData(), conf);
splits.add(split);
}
partitionNum++;