You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How can i apply multiple filters to a group by query following does not work
filters = (pydruid.utils.filters.Dimension("unit")=='000721') & (pydruid.utils.filters.Dimension("val") > 0)
query1 = query.groupby(
datasource=dataSource,
granularity='minute',
#intervals='2016-08-01/p12w',
#intervals='2016-08-01/pt24h',
intervals='2016-08-11/2016-08-15',
dimensions=["GPN"],
filter=filters,
aggregations={"val_sum": ag.doublesum("val"),"val_count": ag.count("val")},
post_aggregations={"Avg": (pag.Field("val_sum") / pag.Field("val_count"))},
context={"timeout": 600000}#,
# limit_spec={
#"type": "default",
# "limit": 50,
# "columns" : ["sensor_val_sum","sensor_val_count"]
# }
)
Gives following error
Traceback (most recent call last):
File "Test_Query_2Filters.py", line 41, in
context={"timeout": 600000}#,
File "/usr/local/lib/python2.7/dist-packages/pydruid/client.py", line 191, in groupby
query = self.query_builder.groupby(kwargs)
File "/usr/local/lib/python2.7/dist-packages/pydruid/query.py", line 316, in groupby
return self.build_query(query_type, args)
File "/usr/local/lib/python2.7/dist-packages/pydruid/query.py", line 250, in build_query
query_dict[key] = Filter.build_filter(val)
File "/usr/local/lib/python2.7/dist-packages/pydruid/utils/filters.py", line 90, in build_filter
filter['fields'] = [Filter.build_filter(f) for f in filter['fields']]
File "/usr/local/lib/python2.7/dist-packages/pydruid/utils/filters.py", line 87, in build_filter
filter = filter_obj.filter['filter']
AttributeError: 'bool' object has no attribute 'filter'
The text was updated successfully, but these errors were encountered:
How can i apply multiple filters to a group by query following does not work
filters = (pydruid.utils.filters.Dimension("unit")=='000721') & (pydruid.utils.filters.Dimension("val") > 0)
query1 = query.groupby(
datasource=dataSource,
granularity='minute',
#intervals='2016-08-01/p12w',
#intervals='2016-08-01/pt24h',
intervals='2016-08-11/2016-08-15',
dimensions=["GPN"],
filter=filters,
aggregations={"val_sum": ag.doublesum("val"),"val_count": ag.count("val")},
post_aggregations={"Avg": (pag.Field("val_sum") / pag.Field("val_count"))},
context={"timeout": 600000}#,
# limit_spec={
#"type": "default",
# "limit": 50,
# "columns" : ["sensor_val_sum","sensor_val_count"]
# }
)
Gives following error
Traceback (most recent call last):
File "Test_Query_2Filters.py", line 41, in
context={"timeout": 600000}#,
File "/usr/local/lib/python2.7/dist-packages/pydruid/client.py", line 191, in groupby
query = self.query_builder.groupby(kwargs)
File "/usr/local/lib/python2.7/dist-packages/pydruid/query.py", line 316, in groupby
return self.build_query(query_type, args)
File "/usr/local/lib/python2.7/dist-packages/pydruid/query.py", line 250, in build_query
query_dict[key] = Filter.build_filter(val)
File "/usr/local/lib/python2.7/dist-packages/pydruid/utils/filters.py", line 90, in build_filter
filter['fields'] = [Filter.build_filter(f) for f in filter['fields']]
File "/usr/local/lib/python2.7/dist-packages/pydruid/utils/filters.py", line 87, in build_filter
filter = filter_obj.filter['filter']
AttributeError: 'bool' object has no attribute 'filter'
The text was updated successfully, but these errors were encountered: