Skip to content

Commit

Permalink
fix(datafusion): handle predicates in aggregates
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud committed Jul 8, 2022
1 parent 9843314 commit 4725571
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ibis/backends/datafusion/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,14 @@ def aggregation(op, expr):
agg = translate(expr)
metrics.append(agg)

if op.predicates:
table = table.filter(
functools.reduce(
operator.and_,
map(translate, op.predicates),
)
)

return table.aggregate(group_by, metrics)


Expand Down

0 comments on commit 4725571

Please sign in to comment.