Skip to content

Commit

Permalink
feat(pyspark): implement xor
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud authored and kszucs committed May 23, 2022
1 parent 2921664 commit 550b35b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ibis/backends/pyspark/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,14 @@ def compile_or(t, expr, scope, timecontext, **kwargs):
)


@compiles(ops.Xor)
def compile_xor(t, expr, scope, timecontext, **kwargs):
op = expr.op()
left = t.translate(op.left, scope, timecontext)
right = t.translate(op.right, scope, timecontext)
return (left | right) & ~(left & right)


@compiles(ops.Equals)
def compile_equals(t, expr, scope, timecontext, **kwargs):
op = expr.op()
Expand Down

0 comments on commit 550b35b

Please sign in to comment.