Add limitSpec support for groupBy queries