// set schemas
load1.setScriptSchema(org.apache.pig.newplan.logical.Util.translateSchema(schema1)) ;
load2.setScriptSchema(org.apache.pig.newplan.logical.Util.translateSchema(schema2));
LOCross cross = new LOCross(plan) ;
// wiring
plan.add(load1) ;
plan.add(load2) ;
plan.add(cross) ;
plan.connect(load1, cross);
plan.connect(load2, cross);
// validate
CompilationMessageCollector collector = new CompilationMessageCollector() ;
TypeCheckingRelVisitor typeChecker = new TypeCheckingRelVisitor(plan, collector);
typeChecker.visit();
printMessageCollector(collector) ;
//printTypeGraph(plan) ;
assertEquals(cross.getSchema().size(), 5) ;
assertEquals(cross.getSchema().getField(0).type, DataType.INTEGER);
assertEquals(cross.getSchema().getField(1).type, DataType.LONG);
assertEquals(cross.getSchema().getField(2).type, DataType.BYTEARRAY);
assertEquals(cross.getSchema().getField(3).type, DataType.FLOAT);
assertEquals(cross.getSchema().getField(4).type, DataType.DOUBLE);
}