Skip to content

Commit

Permalink
feat(exasol): add support for bit operations (#8741)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicoretti authored Mar 22, 2024
1 parent 76d8ef0 commit 4aa721e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
15 changes: 15 additions & 0 deletions ibis/backends/exasol/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,3 +232,18 @@ def visit_HexDigest(self, op, *, arg, how):
)
func = self.f[ibis2exasol[how]]
return func(arg)

def visit_BitwiseLeftShift(self, op, *, left, right):
return self.cast(self.f.bit_lshift(left, right), op.dtype)

def visit_BitwiseRightShift(self, op, *, left, right):
return self.cast(self.f.bit_rshift(left, right), op.dtype)

def visit_BitwiseAnd(self, op, *, left, right):
return self.cast(self.f.bit_and(left, right), op.dtype)

def visit_BitwiseOr(self, op, *, left, right):
return self.cast(self.f.bit_or(left, right), op.dtype)

def visit_BitwiseXor(self, op, *, left, right):
return self.cast(self.f.bit_xor(left, right), op.dtype)
3 changes: 0 additions & 3 deletions ibis/backends/tests/test_numeric.py
Original file line number Diff line number Diff line change
Expand Up @@ -1415,7 +1415,6 @@ def test_constants(con, const):
param(lambda t: t.int_col, lambda _: 3, id="col_scalar"),
],
)
@pytest.mark.notimpl(["exasol"], raises=ExaQueryError)
@flink_no_bitwise
def test_bitwise_columns(backend, con, alltypes, df, op, left_fn, right_fn):
expr = op(left_fn(alltypes), right_fn(alltypes)).name("tmp")
Expand Down Expand Up @@ -1452,7 +1451,6 @@ def test_bitwise_columns(backend, con, alltypes, df, op, left_fn, right_fn):
],
)
@pytest.mark.notimpl(["oracle"], raises=OracleDatabaseError)
@pytest.mark.notimpl(["exasol"], raises=ExaQueryError)
@flink_no_bitwise
def test_bitwise_shift(backend, alltypes, df, op, left_fn, right_fn):
expr = op(left_fn(alltypes), right_fn(alltypes)).name("tmp")
Expand Down Expand Up @@ -1494,7 +1492,6 @@ def test_bitwise_shift(backend, alltypes, df, op, left_fn, right_fn):
("left", "right"),
[param(4, L(2), id="int_col"), param(L(4), 2, id="col_int")],
)
@pytest.mark.notimpl(["exasol"], raises=ExaQueryError)
@flink_no_bitwise
def test_bitwise_scalars(con, op, left, right):
expr = op(left, right)
Expand Down

0 comments on commit 4aa721e

Please sign in to comment.