public void testEmptyBagConst() throws Exception{
String query = "a = foreach (load 'b') generate {};" +
"store a into 'output';";
LogicalPlan lp = buildPlan(query);
Operator store = lp.getSinks().get(0);
LOForEach foreach = (LOForEach) lp.getPredecessors(store).get(0);
LOGenerate gen = (LOGenerate)foreach.getInnerPlan().getSinks().get(0);
LogicalExpressionPlan exprPlan = gen.getOutputPlans().get(0);
Operator logOp = exprPlan.getSources().get(0);
Assert.assertTrue( logOp instanceof ConstantExpression);
ConstantExpression loConst = (ConstantExpression)logOp;
Assert.assertTrue(loConst.getType() == DataType.BAG);
Assert.assertTrue(loConst.getValue() instanceof DataBag);
Assert.assertTrue(loConst.getValue().equals(BagFactory.getInstance().newDefaultBag()));
String s = foreach.getSchema().toString(false);
Assert.assertTrue( s.equals(":bag{}") );
}