You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-zh@flink.apache.org by 唐世伟 <st...@126.com> on 2023/03/06 11:46:13 UTC

flinkSQL无法实现两个timestamp(3) 相减

我们需要对两个时间相减,精度为毫秒。但是无论是TIMESTAMPDIFF函数,还是先转成UNIX_TIMESTAMP,都只支持秒的精度。请问还有其他方法吗?

Re: flinkSQL无法实现两个timestamp(3) 相减

Posted by Shammon FY <zj...@gmail.com>.
Hi

如果没有现成的系统函数,你可以写个自定义udf来实现
https://nightlies.apache.org/flink/flink-docs-master/docs/dev/table/functions/udfs/

Best,
Shammon


On Mon, Mar 6, 2023 at 7:46 PM 唐世伟 <st...@126.com> wrote:

>
> 我们需要对两个时间相减,精度为毫秒。但是无论是TIMESTAMPDIFF函数,还是先转成UNIX_TIMESTAMP,都只支持秒的精度。请问还有其他方法吗?