@Test
public void testQueryOrderByWithSchema() throws FrontendException {
planTester.buildPlan("a = load 'a' as (url,hitCount);");
LogicalPlan lp = planTester.buildPlan("b = order a by $1;");
LOSort sort = (LOSort)lp.getSuccessors(lp.getRoots().get(0)).get(0);
RequiredFields sortRelevantFields0 = sort.getRelevantInputs(0, 0).get(0);
assertTrue(sortRelevantFields0.getNeedAllFields() == false);
assertTrue(sortRelevantFields0.getNeedNoFields() == false);
assertTrue(sortRelevantFields0.getFields().size() == 1);
assertTrue(sortRelevantFields0.getFields().contains(new Pair<Integer, Integer>(0, 0)));
RequiredFields sortRelevantFields1 = sort.getRelevantInputs(0, 1).get(0);
assertTrue(sortRelevantFields1.getNeedAllFields() == false);
assertTrue(sortRelevantFields1.getNeedNoFields() == false);
assertTrue(sortRelevantFields1.getFields().size() == 1);
assertTrue(sortRelevantFields1.getFields().contains(new Pair<Integer, Integer>(0, 1)));
}