Query result miss-match with user intent when specifying query granularity as "day"

Hi Druid team,

Our production environment locates on UTC+8 timezone, and there are 2 tranquility apps for real-time ingestion.
The time stamp of records is based on UTC+8, these records will be converted to UTC time after loaded into druid.

When querying with granularity of “day”, in fact , a day in druid is [00:00:00 ~23:59:59], but we actually want [00:00:00+8:00 ~23:59:59+8:00], converting to UTC time zone is [pre day 16:00:00 ~ current day 15:59:59 ], which is not the same with druid “day”.

Therefore we cannot get the exact daily metrics (with local time) when querying with “day” granularity.

Could you share some tips on this problem?

Thanks in advance.

Xuehui

Hey Xuehui,

Instead of setting granularity to “day”, you can use a PeriodGranularity with the “timeZone” field and get something other than UTC. See here: http://druid.io/docs/latest/querying/granularities.html