// We also need to update the output Schema with these deletions.
// Note that, output storage handlers never sees partition columns in data
// or schema.
HCatSchema schemaWithoutParts = new HCatSchema(schema.getFields());
for (String partKey : partMap.keySet()) {
Integer idx;
if ((idx = schema.getPosition(partKey)) != null) {
posOfPartCols.add(idx);
schemaWithoutParts.remove(schema.get(partKey));
}
}
// Also, if dynamic partitioning is being used, we want to
// set appropriate list of columns for the columns to be dynamically specified.
// These would be partition keys too, so would also need to be removed from
// output schema and partcols
if (jobInfo.isDynamicPartitioningUsed()) {
for (String partKey : jobInfo.getDynamicPartitioningKeys()) {
Integer idx;
if ((idx = schema.getPosition(partKey)) != null) {
posOfPartCols.add(idx);
posOfDynPartCols.add(idx);
schemaWithoutParts.remove(schema.get(partKey));
}
}
}
HCatUtil.validatePartitionSchema(