Skip to content

Commit

Permalink
fix(pyspark): handle predicates in Aggregation
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud authored and kszucs committed Jun 13, 2022
1 parent 1509b1d commit 842c307
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ibis/backends/pyspark/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,15 @@ def compile_aggregation(t, expr, scope, timecontext, **kwargs):

src_table = t.translate(op.table, scope, timecontext)

if op.predicates:
src_table = src_table.filter(
t.translate(
functools.reduce(operator.and_, op.predicates),
scope,
timecontext,
)
)

if op.by:
context = AggregationContext.GROUP
aggs = [
Expand Down

0 comments on commit 842c307

Please sign in to comment.