if(inputSchema == null) {
if(outputSchema != null) {
//determine schema returned null and the user specified a schema
//OR
//the predecessor did not have a schema and the user specified a schema
mProjectionMap = new ProjectionMap(false);
return mProjectionMap;
}
}
if(Schema.equals(inputSchema, outputSchema, false, true)) {
//there is a one is to one mapping between input and output schemas
mProjectionMap = new ProjectionMap(false);
return mProjectionMap;
} else {
MultiMap<Integer, ProjectionMap.Column> mapFields = new MultiMap<Integer, ProjectionMap.Column>();
//compute the mapping assuming its a prefix projection
for(int i = 0; i < inputSchema.size(); ++i) {
mapFields.put(i, new ProjectionMap.Column(new Pair<Integer, Integer>(0, i)));
}
mProjectionMap = new ProjectionMap(mapFields, null, null);
return mProjectionMap;
}
}