Any way to not return Timeseries samples with no data?

I’d like for druid to respond with this for a timeseries query:

[

{“ts”:15,“count”:10,“metric”:1880},

{“ts”:17,“count”:15,“metric”:3301},

] // 2 samples

rather than:

[

{“ts”:0,“count”:0,“metric”:0},

{“ts”:1,“count”:0,“metric”:0},

{“ts”:15,“count”:10,“metric”:1880},

{“ts”:16,“count”:0,“metric”:0},

{“ts”:17,“count”:15,“metric”:3301},

{“ts”:59,“count”:0,“metric”:0}

] // 60 samples

So that an interval divided into samples will only return data in the response for samples that have non-empty values (and the missing samples will be assumed to be empty/zero).

Is this possible?

Thanks for your help.

Duane

Hey Duane, it’s possible to do this by disabling zero-filling. You can do that in current Druid versions, although it was undocumented until recently. You can see the docs here for now, until they’re published on the site: https://github.com/druid-io/druid/blob/master/docs/content/querying/timeseriesquery.md

Thanks Gian, this is exactly what I needed.