Add tests with a HAVING clause both in testGroupByA1 and testGroupByPartitionKey to make sure that the filter gets applied to the correct agg node in each case.