Skip to content

Commit 0bcf16f

Browse files
committed
bug(flink): unit is ignored when str cast to timestamp
1 parent 15ff868 commit 0bcf16f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

ibis/backends/sql/compilers/flink.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,8 @@ def visit_Cast(self, op, *, arg, to):
423423
self.f.convert_tz(self.cast(arg, dt.string), "UTC+0", tz)
424424
)
425425
else:
426+
if to.unit == dt.TimestampUnit.SECOND:
427+
return self.f.to_timestamp(arg)
426428
return self.f.to_timestamp(arg, "yyyy-MM-dd HH:mm:ss.SSS")
427429
elif to.is_json():
428430
return arg

0 commit comments

Comments
 (0)