throw new AssertionError("Group plans should have only one output");
}
groupPlanSchemas.add(((LogicalExpression)expPlan.getSources().get(0)).getFieldSchema());
}
LogicalSchema sch = group.getSchema();
//if the group plans are associated with same load function , associate
//same load fucntion with group column schema
if (getAssociatedLoadFunc(group)!=null) {
addUidLoadFuncToMap(sch.getField(0).uid, rel2InputFuncMap.get(group));
if (sch.getField(0).schema!=null)
setLoadFuncForUids(sch.getField(0).schema, rel2InputFuncMap.get(group));
}
else
mapMatchLoadFuncToUid(sch.getField(0), groupPlanSchemas);
//set the load func spec for the bags in the schema, this helps if
// the input schemas are not set
//group schema has a group column followed by bags corresponding to each
// input
if(sch.size() != inputs.size()+1 ){
throw new AssertionError("cogroup schema size not same as number of inputs");
}
for(int i=1; i < sch.size(); i++){
long uid = sch.getField(i).uid;
LogicalRelationalOperator input = (LogicalRelationalOperator) inputs.get(i-1);
if(getAssociatedLoadFunc(input) != null){
addUidLoadFuncToMap(uid, rel2InputFuncMap.get(input));
}
}