@Test
public void testGroupByHaving() throws Exception {
Plan plan = plan("select avg(date), name from users group by name having min(date) > '1970-01-01'");
Iterator<PlanNode> iterator = plan.iterator();
PlanNode planNode = iterator.next();
assertThat(planNode, instanceOf(CollectNode.class));
CollectNode collectNode = (CollectNode)planNode;
assertThat(collectNode.projections().size(), is(1));
assertThat(collectNode.projections().get(0), instanceOf(GroupProjection.class));