planTester.buildPlan("d = foreach c generate group, a.(field1, field2), b.(field4);") ;
planTester.buildPlan("e = foreach d generate group, flatten($1), flatten($2);") ;
LogicalPlan plan = planTester.buildPlan("f = foreach e generate group, field1 + 1, field4 + 2.0;") ;
// validate
CompilationMessageCollector collector = new CompilationMessageCollector() ;
TypeCheckingValidator typeValidator = new TypeCheckingValidator() ;
try {
typeValidator.validate(plan, collector) ;
}
catch (PlanValidationException pve) {
//not good
}
printMessageCollector(collector) ;
printTypeGraph(plan) ;
planTester.printPlan(plan, TypeCheckingTestUtil.getCurrentMethodName());
if (collector.hasError()) {
throw new AssertionError("Expect no error") ;
}
LOForEach foreach = (LOForEach)plan.getLeaves().get(0);