Counts in a date range

Given a Druid data set in which each record describes a date range with two date fields (e.g. start_date and end_date), is there a way to query this data set using different granularities such that each record will get counted in every timestamp group that falls in the range?

For example, if we have data:

[{

“start_date”: “2018-12-01T00:00:00.000Z”,

“end_date”: “2019-01-31T00:00:00.000Z”

},

{

“start_date”: “2018-12-01T00:00:00.000Z”,

“end_date”: “2018-12-31T00:00:00.000Z”

},

{

“start_date”: “2018-11-01T00:00:00.000Z”,

“end_date”: “2018-11-30T00:00:00.000Z”

}]

The result of a query with “month” granularity would be:

[{

“version”: “v1”,

“timestamp”: “2018-11-01T00:00:00.000Z”,

“event”: {

“count”: 1.0

}

},

{

“version”: “v1”,

“timestamp”: “2018-12-01T00:00:00.000Z”,

“event”: {

“count”: 2.0

}

},

{

“version”: “v1”,

“timestamp”: “2019-01-01T00:00:00.000Z”,

“event”: {

“count”: 1.0

}

}]