public void testStrangeAggregations() throws Exception {
Query query = QueryBuilder.getInstance().parseQuery(
" SELECT `a, b`, avg, min(min), max(max) group by `a, b`, avg "
+ " pivot count");
QuerySelection selection = query.getSelection();
QueryGroup group = query.getGroup();
QueryPivot pivot = query.getPivot();
assertEquals(Lists.newArrayList(new SimpleColumn("a, b"),
new SimpleColumn("avg"),
new AggregationColumn(new SimpleColumn("min"), AggregationType.MIN),
new AggregationColumn(new SimpleColumn("max"), AggregationType.MAX)),
selection.getColumns());
assertEquals(Lists.newArrayList("a, b", "avg"), group.getColumnIds());
assertEquals(Lists.newArrayList("count"), pivot.getColumnIds());
}