planTester.buildPlan("a = load 'a' using BinStorage() ;") ;
planTester.buildPlan("b = foreach a generate $0#'key1';") ;
LogicalPlan plan = planTester.buildPlan("c = foreach b generate $0#'key2' + 1 ;") ;
// 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);