[Druid 0.9.0] Indexing Segments using coordinator - question about granularity

I am trying to index segments using csv files. I have attached a sample csv and the index task json that I am submitting to coordinator.

My question is that after I have done that as the segment and query granularity are both hour the data should be aggregated by hour. Correct? But when I query using

{

“metric”: “count”,

“aggregations”: [

{

“type”: “count”,

“name”: “count”

}

],

“dimension”: “time”,

“intervals”: “2016-11-10T16:31:26+00:00/2016-11-17T16:31:26+00:00”,

“dataSource”: “MyEvent”,

“granularity”: “all”,

“threshold”: 50000,

“postAggregations”: ,

“queryType”: “topN”

}

Then I get the below which shows that the data has not been aggregated by hour.

[

{

“timestamp”: “2016-11-15T00:00:00.000Z”,

“result”: [

{

“count”: 1,

“time”: “2016-11-15T00:01:43.309+0000”

},

{

“count”: 1,

“time”: “2016-11-15T00:02:22.310+0000”

}

]

}

]

MyEvent.csv (72 Bytes)

task.json (986 Bytes)

I went to the folder containing the segments and saw that segments have been created with hour granularity. But I am not clear why I am able to query on less than hour granularity.

Hi Assem,

seems like your index task is creating another time dimension (other than the one created by druid) and that dimension it will not be truncated it will be seen as a dimension eg (a string value like billy and hilly…)

So if you want you don’t have to include time as part of the dimension list and that will work as you expect i guess.