druid-io / pydruid

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

query granularity doesn't allow to set origin #181

Closed sampathmora closed 4 years ago

sampathmora commented 4 years ago

druid documentation reference Query granularity doesn't allow to set origin as it only takes a string as value.

example:

group = client.groupby(
              datasource='twitterstream',
         -- granularity='week', 
        ++ granularity={"type": "week", "origin":"1970-01-04T00:00:00"}
              intervals='2019-09-29/2019-09-12',
              dimensions=["user_name", "reply_to_name"],
              filter=~(Dimension("reply_to_name") == "Not A Reply"),
              aggregations={"count": doublesum("count")},
              context={"timeout": 1000}
              limit_spec={
                  "type": "default",
                  "limit": 50,
                  "columns" : ["count"]
              }
        )