public boolean isEmpty() { return aggregators == null || aggregators.getAggregatorCount() == 0; }
public ClientAggregators(List<SingleAggregateFunction> functions, int minNullableIndex) { super(functions.toArray(new SingleAggregateFunction[functions.size()]), getAggregators(functions), minNullableIndex); this.tempValueSet = ValueBitSet.newInstance(schema); }
ClientAggregators clientAggregators = new ClientAggregators(aggFuncs, minNullableIndex); context.getAggregationManager().setAggregators(clientAggregators);
aggregationManager.setAggregators(new ClientAggregators(Collections.<SingleAggregateFunction>singletonList(func), 1)); ClientAggregators aggregators = aggregationManager.getAggregators(); return aggregators;
@Test public void testNoAggregatorForOrderBy() throws SQLException { Connection conn = DriverManager.getConnection(getUrl(), PropertiesUtil.deepCopy(TEST_PROPERTIES)); conn.createStatement().execute("create table test (pk1 integer not null, pk2 integer not null, constraint pk primary key (pk1,pk2))"); StatementContext context = compileStatement("select count(distinct pk1) from test order by count(distinct pk2)"); assertEquals(1, context.getAggregationManager().getAggregators().getAggregatorCount()); context = compileStatement("select sum(pk1) from test order by count(distinct pk2)"); assertEquals(1, context.getAggregationManager().getAggregators().getAggregatorCount()); context = compileStatement("select min(pk1) from test order by count(distinct pk2)"); assertEquals(1, context.getAggregationManager().getAggregators().getAggregatorCount()); context = compileStatement("select max(pk1) from test order by count(distinct pk2)"); assertEquals(1, context.getAggregationManager().getAggregators().getAggregatorCount()); // here the ORDER BY is not optimized away context = compileStatement("select avg(pk1) from test order by count(distinct pk2)"); assertEquals(2, context.getAggregationManager().getAggregators().getAggregatorCount()); }
ClientAggregators clientAggregators = new ClientAggregators(aggFuncs, minNullableIndex); context.getAggregationManager().setAggregators(clientAggregators);
public ClientAggregators(List<SingleAggregateFunction> functions, int minNullableIndex) { super(functions.toArray(new SingleAggregateFunction[functions.size()]), getAggregators(functions), minNullableIndex); this.tempValueSet = ValueBitSet.newInstance(schema); }
public boolean isEmpty() { return aggregators == null || aggregators.getAggregatorCount() == 0; }
ClientAggregators clientAggregators = new ClientAggregators(aggFuncs, minNullableIndex); context.getAggregationManager().setAggregators(clientAggregators);
public ClientAggregators(List<SingleAggregateFunction> functions, int minNullableIndex) { super(functions.toArray(new SingleAggregateFunction[functions.size()]), getAggregators(functions), minNullableIndex); this.tempValueSet = ValueBitSet.newInstance(schema); }
public boolean isEmpty() { return aggregators == null || aggregators.getAggregatorCount() == 0; }