@Test
public void testQueryUnionWithSchema() throws FrontendException {
String query = "c = union (load 'a' as (url, hitcount)), (load 'b' as (url, rank));";
LogicalPlan lp = planTester.buildPlan(query);
LOUnion union = (LOUnion)lp.getLeaves().get(0);
RequiredFields unionRelevantFields0 = union.getRelevantInputs(0, 0).get(0);
assertTrue(unionRelevantFields0.getNeedAllFields() == false);
assertTrue(unionRelevantFields0.getNeedNoFields() == false);
assertTrue(unionRelevantFields0.getFields().size() == 1);
assertTrue(unionRelevantFields0.getFields().contains(new Pair<Integer, Integer>(0, 0)));
RequiredFields unionRelevantFields1 = union.getRelevantInputs(0, 0).get(1);
assertTrue(unionRelevantFields1.getNeedAllFields() == false);
assertTrue(unionRelevantFields1.getNeedNoFields() == false);
assertTrue(unionRelevantFields1.getFields().size() == 1);
assertTrue(unionRelevantFields1.getFields().contains(new Pair<Integer, Integer>(1, 0)));
}