Skip to content

Commit

Permalink
feat(flink): implement ops.FloorDivide operation
Browse files Browse the repository at this point in the history
  • Loading branch information
deepyaman committed Sep 13, 2023
1 parent 7ea52cd commit 823ba44
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 8 additions & 0 deletions ibis/backends/flink/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,12 @@ def _window(translator: ExprTranslator, op: ops.Node) -> str:
return result


def _floor_divide(translator: ExprTranslator, op: ops.Node) -> str:
left = translator.translate(op.left)
right = translator.translate(op.right)
return f"FLOOR(({left}) / ({right}))"


operation_registry.update(
{
# Unary operations
Expand Down Expand Up @@ -212,5 +218,7 @@ def _window(translator: ExprTranslator, op: ops.Node) -> str:
ops.Where: _filter,
ops.TimestampFromUNIX: _timestamp_from_unix,
ops.Window: _window,
# Binary operations
ops.FloorDivide: _floor_divide,
}
)
1 change: 0 additions & 1 deletion ibis/backends/tests/test_numeric.py
Original file line number Diff line number Diff line change
Expand Up @@ -1143,7 +1143,6 @@ def test_backend_specific_numerics(backend, con, df, alltypes, expr_fn, expected
backend.assert_series_equal(result, expected)


# marks=pytest.mark.notimpl(["datafusion"]),
@pytest.mark.parametrize(
"op",
[
Expand Down

0 comments on commit 823ba44

Please sign in to comment.