planTester.buildPlan("a = load 'a' using BinStorage() as (field1, field2: float, field3: chararray );") ;
planTester.buildPlan("b = group a by field1 ;") ;
LogicalPlan plan = planTester.buildPlan("c = foreach b generate group + 1.0 ;") ;
// validate
CompilationMessageCollector collector = new CompilationMessageCollector() ;
TypeCheckingValidator typeValidator = new TypeCheckingValidator() ;
typeValidator.validate(plan, collector) ;
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);
LogicalPlan foreachPlan = foreach.getForEachPlans().get(0);