= join.getJoinPlans() ;
List<LogicalOperator> inputs = join.getInputs() ;
// Type checking internal plans.
for(int i=0;i < inputs.size(); i++) {
LogicalOperator input = inputs.get(i) ;
List<LogicalPlan> innerPlans
= new ArrayList<LogicalPlan>(joinColPlans.get(input)) ;
for(int j=0; j < innerPlans.size(); j++) {
LogicalPlan innerPlan = innerPlans.get(j) ;
// Check that the inner plan has only 1 output port
if (!innerPlan.isSingleLeafPlan()) {
int errCode = 1057;
String msg = "Join's inner plans can only"
+ " have one output (leaf)" ;
msgCollector.collect(msg, MessageType.Error) ;
throw new TypeCheckerException(msg, errCode, PigException.INPUT) ;
}
checkInnerPlan(join.getAlias(), innerPlans.get(j)) ;
}
}
try {
if (!join.isTupleJoinCol()) {
// merge all the inner plan outputs so we know what type
// our group column should be
// TODO: Don't recompute schema here
//byte groupType = schema.getField(0).type ;
byte groupType = join.getAtomicJoinColType() ;
// go through all inputs again to add cast if necessary
for(int i=0;i < inputs.size(); i++) {
LogicalOperator input = inputs.get(i) ;
List<LogicalPlan> innerPlans
= new ArrayList<LogicalPlan>(joinColPlans.get(input)) ;
// Checking innerPlan size already done above
byte innerType = innerPlans.get(0).getSingleLeafPlanOutputType() ;
if (innerType != groupType) {
insertAtomicCastForJoinInnerPlan(innerPlans.get(0),
join,
groupType) ;
}
}
}
else {
// TODO: Don't recompute schema here
//Schema groupBySchema = schema.getField(0).schema ;
Schema groupBySchema = join.getTupleJoinSchema() ;
// go through all inputs again to add cast if necessary
for(int i=0;i < inputs.size(); i++) {
LogicalOperator input = inputs.get(i) ;
List<LogicalPlan> innerPlans
= new ArrayList<LogicalPlan>(joinColPlans.get(input)) ;
for(int j=0;j < innerPlans.size(); j++) {
LogicalPlan innerPlan = innerPlans.get(j) ;
byte innerType = innerPlan.getSingleLeafPlanOutputType() ;