using chunkPeriod yields different results

I ran a topN query spanning several days of data once without the chunkPeriod setting and once with a chunkPeriod set to P1D and I get entirely different results back, both for normal measures and unique counts.

Both the segment-granularity and the query granularity are HOUR.
Am I doing something wrong?

Here’s my query


without chunking
“count”: 6449711032,
“SEGMENT”: “130019751”

with chunking
“count”: 715800923,
“SEGMENT”: “130019751”

If I use a timeseries query instead with a granularity of DAY, the outcome is even more strange because with chunking, I don’t get results back for each day but some days are missing or I just get one result for the last day of the query period whereas without chunking, I get one result back for each day.


Can you run this query again with the cached disabled?

Set useCache and populateCache to false in the context.

ChunkPeriod failed to produce correct results in some cases due to a bug that was fixed in . Unfortunately, it appears, it did get backported to 0.9.0 release. Please use that patch and that should fix the issue. It will be released in 0.9.1 .

– Himanshu

Awesome! Thank you so much both of you for your support and your quick replies. Much appreciated.