Currently I have segments with HOUR segment granularity and also HOUR query granularity. Compactionallows us to change segment granularity from HOUR to DAY. On similar lines is it possible to change the query granularity from DAY to HOUR as well during compaction? I looked at Druid compaction task configuration, and I don’t see any option as such for changing query granularity during compaction.
Once the data is ingested with higher queryGranularity level ( let say DAY ) into the data source ( let say D1) it doesn’t make any sense to change it to lower granularity level ( HOUR) as you actal data ingested into the datasource D1 does not have hour level details.
Do for example if you input data is :
{“timestamp”:“2019-10-21T21:31:01.498Z”,“id”:“1”}
Post ingestion with " DAY level query granularity level, It will look like :
“timestamp”:“2019-10-21T00:00:00.498Z”,“id”:“1”}
If you see , its just have DAY level details here.
I do not think we can change the query granularity once the data is ingested into Druid. Query granularity will summarize the data and then stores the data into Druid.
So if you have Day query granularity, then the data for a given day will be completely summarized into one date(timestamp) for all the events from that day.
For-ex, Timestamp 2015-12-21T10:45:00 will be 2015-12-21T00:00:00 if the query granularity is set to “Day”.
I dont think the Compaction task will help in changing the queryGranularity.
The purpose of the compaction task to compacting a large number of smaller segments ( Kbs -300MB) into decent size segments ( 500MB-900MB) to improve the query performance.