druid-io / pydruid

A Python connector for Druid
Other
506 stars 194 forks source link

Custom duration granularities? #83

Closed azymnis closed 7 years ago

azymnis commented 7 years ago

Based on what I read in the docs, Druid supports custom granularities like this:

{"type": "duration", "duration": 7200000}

Is there support for that in PyDruid?

dakra commented 7 years ago

Sure, pydruid just passes whatever you put to granularity to druid. So, for example, you can just do druid.groupby(...., granularity={"type": "duration", "duration": 7200000}, ....)

azymnis commented 7 years ago

Oh you just json serialize all fields of the query... Ok that makes sense, thanks. Might be good to document that somewhere