public void testNotPossibleFilter() throws Exception {
// Plan here is
// Load (name, cuisines{t:(name)}) -> foreach gen name,flatten(cuisines)
// -> filter $1 == 'joe' --> stor
LogicalPlan plan = null;
LOLoad load = null;
LOForEach foreach = null;
LOFilter filter = null;
LOStore stor = null;
plan = new LogicalPlan();
LogicalSchema schema = new LogicalSchema();
schema.addField(new LogicalSchema.LogicalFieldSchema("name", null, DataType.CHARARRAY));
LogicalSchema bagSchema = new LogicalSchema();
LogicalSchema bagTupleSchema = new LogicalSchema();
bagTupleSchema.addField( new LogicalSchema.LogicalFieldSchema("name", null, DataType.CHARARRAY) );
bagSchema.addField( new LogicalSchema.LogicalFieldSchema( "t", bagTupleSchema, DataType.TUPLE ) );
schema.addField(new LogicalSchema.LogicalFieldSchema("cuisines", bagSchema, DataType.BAG));
load = new LOLoad(null, schema, plan);
load.setAlias("A");
plan.add(load);
foreach = new LOForEach(plan);
LogicalPlan innerPlan = new LogicalPlan();
LOInnerLoad innerLoad = new LOInnerLoad(innerPlan, foreach, 0);
innerPlan.add(innerLoad);
LOInnerLoad innerLoad2 = new LOInnerLoad(innerPlan, foreach, 1);
innerPlan.add(innerLoad2);
LogicalExpressionPlan namePrj = new LogicalExpressionPlan();
ProjectExpression prjName = new ProjectExpression(namePrj, DataType.CHARARRAY, 0, 0);
namePrj.add(prjName);
LogicalExpressionPlan cuisinesPrj = new LogicalExpressionPlan();
ProjectExpression prjCuisines = new ProjectExpression(cuisinesPrj, DataType.BAG, 1, 0);
cuisinesPrj.add(prjCuisines);
List<LogicalExpressionPlan> expPlans = new ArrayList<LogicalExpressionPlan>();
expPlans.add(namePrj);
expPlans.add(cuisinesPrj);
boolean flatten[] = new boolean[2];
flatten[0] = false;
flatten[1] = true;
LOGenerate generate = new LOGenerate(innerPlan, expPlans, flatten);
innerPlan.add(generate);
innerPlan.connect(innerLoad, generate);
innerPlan.connect(innerLoad2, generate);
foreach.setInnerPlan(innerPlan);
foreach.setAlias("B");
plan.add(foreach);