Support segment granularity and query granularity in Druid

What are the supported segmentGranularity and queryGranularity options?

As per doc here - http://druid.io/docs/latest/querying/granularities.html only the following are supported -

all, none, minute, fifteen_minute, thirty_minute, hour and day

Are these the only ones supported? Can we say 10 minutes? And whatz the reason behind not having more flexibility here ?

Thanks!

If you scroll down the page a bit, you can define arbitrary granularities using any ISO 8601 Period
http://druid.io/docs/latest/querying/granularities.html#period-granularities

It is slightly confusing, but using the periods, can I do the following -

I currently have -

“granularitySpec” : {
“type” : “uniform”,
“segmentGranularity” : “FIFTEEN_MINUTE”,
“queryGranularity” : “NONE”
},

``

And can I do this instead ? -

“granularitySpec” : {
“type”: “period”,
“segmentGranularity” : “P30M”
“queryGranularity” : “P10M”
},

``

I think it doesn’t work, these periods look like they only work for queries. Can FJ or Giam confirm?

Thank!

segmentGranularity is an enum and is restricted to the values defined here: https://github.com/metamx/java-util/blob/master/src/main/java/com/metamx/common/Granularity.java

queryGranularity can be anything, the link Xavier posted applies to those.

Thanks Gian!

So for I can say - “queryGranularity” : “P10M” ?? And should I specify the type as period or uniform ?

Thanks!

I guess you want queryGranularity PT10M (10 minutes) not P10M (10 months). But yes that would work. The type should still be “uniform”. So something like this should work,

“granularitySpec” : {

“type” : “uniform”,

“segmentGranularity” : “HOUR”,

“queryGranularity” : “PT10M”

},

Thanks Gian!