LogicalPlanTester lpt = new LogicalPlanTester( pc );
lpt.buildPlan( "A = LOAD 'file.txt' AS (name, cuisines : bag{ t : ( cuisine ) } );" );
lpt.buildPlan( "B = FOREACH A GENERATE name, flatten(cuisines);" );
lpt.buildPlan( "C = FILTER B BY $1 == 'french';" );
lpt.buildPlan( "D = FILTER C BY name == 'joe';" );
org.apache.pig.impl.logicalLayer.LogicalPlan plan = lpt.buildPlan( "E = STORE D INTO 'empty';" );
LogicalPlan newLogicalPlan = migrateAndOptimizePlan( plan );
Operator load = newLogicalPlan.getSources().get( 0 );
Assert.assertTrue( load instanceof LOLoad );
Operator filter = newLogicalPlan.getSuccessors( load ).get( 0 );