@Test
public void testQueryDistinctWithSchema() throws FrontendException {
planTester.buildPlan("a = load 'a' as (url,hitCount);");
LogicalPlan lp = planTester.buildPlan("b = distinct a;");
LODistinct distinct = (LODistinct)lp.getLeaves().get(0);
List<RequiredFields> distinctRelevantFields0 = distinct.getRelevantInputs(0, 0);
assertTrue(distinctRelevantFields0.get(0).getFields().size()==1);
assertTrue(distinctRelevantFields0.get(0).getNeedAllFields()==false);
assertTrue(distinctRelevantFields0.get(0).getNeedNoFields()==false);
assertTrue(distinctRelevantFields0.get(0).getFields().get(0).first == 0);
assertTrue(distinctRelevantFields0.get(0).getFields().get(0).second == 0);
List<RequiredFields> distinctRelevantFields1 = distinct.getRelevantInputs(0, 1);
assertTrue(distinctRelevantFields1.get(0).getFields().size()==1);
assertTrue(distinctRelevantFields1.get(0).getNeedAllFields()==false);
assertTrue(distinctRelevantFields1.get(0).getNeedNoFields()==false);
assertTrue(distinctRelevantFields1.get(0).getFields().get(0).first == 0);
assertTrue(distinctRelevantFields1.get(0).getFields().get(0).second == 1);