private ParallelIteratorFactory wrapParallelIteratorFactory () { ParallelIteratorFactory innerFactory; QueryServices services = context.getConnection().getQueryServices(); if (groupBy.isEmpty() || groupBy.isOrderPreserving()) { if (ScanUtil.isPacingScannersPossible(context)) { innerFactory = ParallelIteratorFactory.NOOP_FACTORY; } else { innerFactory = new SpoolingResultIterator.SpoolingResultIteratorFactory(services); } } else { innerFactory = new OrderingResultIteratorFactory(services,this.getOrderBy()); } if (parallelIteratorFactory == null) { return innerFactory; } // wrap any existing parallelIteratorFactory return new WrappingResultIteratorFactory(innerFactory, parallelIteratorFactory); }
assertTrue(orderBy.getOrderByExpressions().get(0).toString().equals("AID")); AggregatePlan innerAggregatePlan=(AggregatePlan)((TupleProjectionPlan)lhsOuterPlan.getDelegate()).getDelegate(); orderBy=innerAggregatePlan.getOrderBy(); assertTrue(orderBy.getOrderByExpressions().size() == 1); assertTrue(orderBy.getOrderByExpressions().get(0).toString().equals("SUM(AGE)")); assertTrue(orderBy.getOrderByExpressions().get(0).toString().equals("BID")); innerAggregatePlan=(AggregatePlan)((TupleProjectionPlan)rhsOuterPlan.getDelegate()).getDelegate(); orderBy=innerAggregatePlan.getOrderBy(); assertTrue(orderBy.getOrderByExpressions().size() == 1); assertTrue(orderBy.getOrderByExpressions().get(0).toString().equals("SUM(CODE)")); assertTrue(orderBy.getOrderByExpressions().get(0).toString().equals("AID")); innerAggregatePlan=(AggregatePlan)((HashJoinPlan)((TupleProjectionPlan)lhsOuterPlan.getDelegate()).getDelegate()).getDelegate(); orderBy=innerAggregatePlan.getOrderBy(); assertTrue(orderBy.getOrderByExpressions().size() == 1); assertTrue(orderBy.getOrderByExpressions().get(0).toString().equals("SUM(B.CODE)")); assertTrue(orderBy.getOrderByExpressions().get(0).toString().equals("AID")); innerAggregatePlan=(AggregatePlan)((HashJoinPlan)((TupleProjectionPlan)rhsOuterPlan.getDelegate()).getDelegate()).getDelegate(); orderBy=innerAggregatePlan.getOrderBy(); assertTrue(orderBy.getOrderByExpressions().size() == 1); assertTrue(orderBy.getOrderByExpressions().get(0).toString().equals("SUM(C.REGION) DESC")); orderBy=innerAggregatePlan.getOrderBy(); assertTrue(orderBy.getOrderByExpressions().size() == 2); assertTrue(orderBy.getOrderByExpressions().get(0).toString().equals("A.AID")); assertTrue(orderBy.getOrderByExpressions().get(0).toString().equals("AID"));
} else { aggResultIterator = new GroupedAggregatingResultIterator( new MergeSortRowKeyResultIterator(iterators, 0, this.getOrderBy() == OrderBy.REV_ROW_KEY_ORDER_BY),aggregators);
private ParallelIteratorFactory wrapParallelIteratorFactory () { ParallelIteratorFactory innerFactory; QueryServices services = context.getConnection().getQueryServices(); if (groupBy.isEmpty() || groupBy.isOrderPreserving()) { if (ScanUtil.isPacingScannersPossible(context)) { innerFactory = ParallelIteratorFactory.NOOP_FACTORY; } else { innerFactory = new SpoolingResultIterator.SpoolingResultIteratorFactory(services); } } else { innerFactory = new OrderingResultIteratorFactory(services,this.getOrderBy()); } if (parallelIteratorFactory == null) { return innerFactory; } // wrap any existing parallelIteratorFactory return new WrappingResultIteratorFactory(innerFactory, parallelIteratorFactory); }
private ParallelIteratorFactory wrapParallelIteratorFactory () { ParallelIteratorFactory innerFactory; QueryServices services = context.getConnection().getQueryServices(); if (groupBy.isEmpty() || groupBy.isOrderPreserving()) { if (ScanUtil.isPacingScannersPossible(context)) { innerFactory = ParallelIteratorFactory.NOOP_FACTORY; } else { innerFactory = new SpoolingResultIterator.SpoolingResultIteratorFactory(services); } } else { innerFactory = new OrderingResultIteratorFactory(services,this.getOrderBy()); } if (parallelIteratorFactory == null) { return innerFactory; } // wrap any existing parallelIteratorFactory return new WrappingResultIteratorFactory(innerFactory, parallelIteratorFactory); }
} else { aggResultIterator = new GroupedAggregatingResultIterator( new MergeSortRowKeyResultIterator(iterators, 0, this.getOrderBy() == OrderBy.REV_ROW_KEY_ORDER_BY),aggregators);
} else { aggResultIterator = new GroupedAggregatingResultIterator( new MergeSortRowKeyResultIterator(iterators, 0, this.getOrderBy() == OrderBy.REV_ROW_KEY_ORDER_BY),aggregators);