Capping the maximum number of results with groupBy v2

Hi all, is there some way capping the maximum number of results with groupBy v2?

With v1 I was able to control it by setting druid.query.groupBy.maxResults, but with the introduction of v2 it is not an option anymore.

There is druid.query.groupBy.maxMergingDictionarySize property,**but I don’t understand it.

Another option is setting druid.processing.buffer.sizeBytes, it doesn’t work well with sketches, as the result size is relatively small however memory consumption is high.

The LimitSpec isn’t an option here as I must know if the result was truncated or not.

I would much appreciate any help.

Hi Denis,

After looking at the documentation for a while, it seems v2 groupBy can only be limited by byte size of the merge buffer, specified by druid.processing.buffer.sizeBytes
and also by timeout druid.server.http.maxQueryTimeout(I specified it on both broker and historical)

If anyone has success with limiting by number of rows, please let us know!

Thanks,

Michael

How about setting the limit to 1 higher than you want, and if you get that extra record, then you know the result was truncated?

Gian

Could you please help me with my problem.I have posted up my questions in community.

Gian Merlino gian@imply.io 于2019年10月15日周二 下午1:17写道:

the url is https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!topic/druid-user/CFm9-vbp1fs

scoffi Michaeal weitianpei@gmail.com 于2019年10月15日周二 下午1:21写道:

It is indeed an option. Though I prefer to stop the computation and wasting cluster resources as I won’t need the data if it is truncated.