Paginated GroupBy

Hello,
We have a use case where we want to run a groupby with aggregations and get all the data out. Is there a way to do this? We don’t want to use select since it doesn’t allow aggregation.

Thanks,
Sandeep

Hey Sandeep,

Not in an “OFFSET / LIMIT” sort of way, as Druid does groupBys “all at once” even if there’s a limit. There are a couple of tricks you can use, though.

  1. Apply a filter to each groupBy to limit the resultset size.

  2. If you’re just wanting one dimension in the grouping, use lexicographic topNs, which let you page through an unlimited number of results.