@Test
public void testQueryForeachGenerateStarWithSchema1() {
String query = "foreach (load 'a' as (url, hitCount)) generate *, COUNT(*) ;";
LogicalPlan lp = planTester.buildPlan(query);
LOForEach foreach = (LOForEach)lp.getLeaves().get(0);
RequiredFields foreachRelevantFields0 = foreach.getRelevantInputs(0, 0).get(0);
assertTrue(foreachRelevantFields0.getNeedAllFields() == false);
assertTrue(foreachRelevantFields0.getNeedNoFields() == false);
assertTrue(foreachRelevantFields0.getFields().size() == 1);
assertTrue(foreachRelevantFields0.getFields().get(0).first == 0);
assertTrue(foreachRelevantFields0.getFields().get(0).second == 0);
RequiredFields foreachRelevantFields1 = foreach.getRelevantInputs(0, 1).get(0);
assertTrue(foreachRelevantFields1.getNeedAllFields() == false);
assertTrue(foreachRelevantFields1.getNeedNoFields() == false);
assertTrue(foreachRelevantFields1.getFields().size() == 1);
assertTrue(foreachRelevantFields1.getFields().get(0).first == 0);
assertTrue(foreachRelevantFields1.getFields().get(0).second == 1);
RequiredFields foreachRelevantFields2 = foreach.getRelevantInputs(0, 2).get(0);
assertTrue(foreachRelevantFields2.getNeedAllFields() == true);
assertTrue(foreachRelevantFields2.getNeedNoFields() == false);
assertTrue(foreachRelevantFields2.getFields() == null);
}