[druid-user] Period granularities: Start of returned timestamps

We are using period granularities as described here (Query granularities · Apache Druid) and we do not pass the “origin” as such.
We load data every Thursday and use weekly segment granularity.

One behavior we see is -
When we use P1W granularity, the returned timestamp starts from the Monday of the same week as the queried interval, and that is as documented. So when queried interval starts on Nov 4 2020 (Wed), response timestamp starts on Nov 2 2020 (Monday).
However, with the same interval, if we just change granularity to P2W or anything other than P1W, the response timestamp starts on the Thursday of the previous week (Oct 29 2020)

Is this as expected ?

I think you are correct in that it is not expected.

As a workaround attempt, can you try using an explicit origin, as in:
{“type”: “period”, “period”: “P2W”, “origin”: “1970-01-01T00:00:00”}

Please report the bug at Issues · apache/druid · GitHub

1 Like