@Test public final void testNext() throws IOException, PlanningException { FileFragment[] frags = StorageManager.splitNG(conf, "employee", employeeMeta, tablePath, Integer.MAX_VALUE); Path workDir = CommonTestingUtil.getTestDir("target/test-data/TestSortExec"); TaskAttemptContext ctx = new TaskAttemptContext(conf, LocalTajoTestingUtility .newQueryUnitAttemptId(), new FileFragment[] { frags[0] }, workDir); ctx.setEnforcer(new Enforcer()); Expr context = analyzer.parse(QUERIES[0]); LogicalPlan plan = planner.createPlan(context); LogicalNode rootNode = optimizer.optimize(plan); PhysicalPlanner phyPlanner = new PhysicalPlannerImpl(conf, sm); PhysicalExec exec = phyPlanner.createPlan(ctx, rootNode); Tuple tuple; Datum preVal = null; Datum curVal; exec.init(); while ((tuple = exec.next()) != null) { curVal = tuple.get(0); if (preVal != null) { assertTrue(preVal.lessThanEqual(curVal).asBool()); } preVal = curVal; } exec.close(); }
@Override abstract public Tuple next() throws IOException;
SortExec extends UnaryPhysicalExec { @Override abstract public Tuple next() throws IOException; }
SortExec extends UnaryPhysicalExec { @Override abstract public Tuple next() throws IOException; SortExec(TaskAttemptContext context, Schema inSchema,
                  Schema outSchema, PhysicalExec child, SortSpec [] sortSpecs); }
SortExec extends UnaryPhysicalExec { @Override abstract public Tuple next() throws IOException; SortExec(TaskAttemptContext context, Schema inSchema,
                  Schema outSchema, PhysicalExec child, SortSpec [] sortSpecs); SortSpec[] getSortSpecs(); Comparator<Tuple> getComparator(); @Override abstract Tuple next(); }
SortExec extends UnaryPhysicalExec { @Override abstract public Tuple next() throws IOException; SortExec(TaskAttemptContext context, Schema inSchema,
                  Schema outSchema, PhysicalExec child, SortSpec [] sortSpecs); SortSpec[] getSortSpecs(); Comparator<Tuple> getComparator(); @Override abstract Tuple next();  }