Use CountOutputWalker when query contains groupBy clause