Skip to content

Commit

Permalink
fix(flink): give true division semantics to flink division operation
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud authored and NickCrews committed Oct 29, 2024
1 parent 6880375 commit 8df3d9c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ibis/backends/sql/compilers/flink.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,10 @@ def visit_TryCast(self, op, *, arg, to):
)
return sge.TryCast(this=arg, to=type_mapper.from_ibis(to))

def visit_Divide(self, op, *, left, right):
dtype = op.dtype
return self.cast(left, dtype) / self.cast(right, dtype)

def visit_FloorDivide(self, op, *, left, right):
return self.f.floor(sge.paren(left) / sge.paren(right))

Expand Down

0 comments on commit 8df3d9c

Please sign in to comment.