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 yidan zhao <hi...@gmail.com> on 2021/06/29 03:37:08 UTC

Re: flink 1.13.0 中cumulate window 使用

是否insert应该和这个cumulate window没关系了。需要考虑你的test_out的定义,定primary key可以试一试。

此外,@Leonard Xu,我想知道window tvf,table values function,这么个词想表达啥呢?表值函数?
其次,为啥语法中是 from table(CUMULATE(...)) 而不是直接 from
CUMULATE(...)。此处的table()的这个table算是啥呢?函数?
那么CUMULATE(...)返回的是啥呢,是某种类型,可以用于table函数的参数吗。 还是 table(xx)理解为类型转换呢?

邹云鹤 <ke...@163.com> 于2021年6月3日周四 下午4:25写道:
>
> hello 大佬,
> 我现在 使用 cumulate 的SQL 如下:insert into `test_out` select a.uid, 'dt', max(a.age) from
> TABLE(
> CUMULATE(TABLE test_in, DESCRIPTOR(proctime), INTERVAL '1' MINUTES, INTERVAL '1' hours)) as a group by uid, window_start, window_end;
>
>
> 是可以运行了,但是发现每次窗口触发, 通过JDBC Sink 写入到数据库执行的都是insert 操作, 如果这个地方需要根据key 在数据库里面进行update 操作,使用CUMULATE WINDOW 可以实现吗?该怎么用这个SQL?
> | |
> 邹云鹤
> |
> |
> kevinyunhe@163.com
> |
> 签名由网易邮箱大师定制
> 在2021年5月28日 11:51,Leonard Xu<xb...@gmail.com> 写道:
> Hi,
>
> Cumulate window 是基于 window TVF 语法的,和之前的 groupWindowFunction 不一样, 你可以参考 [1]
> Window TVF 也支持了 tumble window, hop window, 并且性能更优,session window 预计会在1.14支持, session window 有需要可以使用老的语法。
>
> Best,
> Leonard
> [1] https://ci.apache.org/projects/flink/flink-docs-release-1.13/zh/docs/dev/table/sql/queries/window-agg/#windowing-tvfs
>
>
> 在 2021年5月28日,11:43,邹云鹤 <ke...@163.com> 写道:
>
> insert into `test_out` select a.uid, 'dt', max(a.age) from `test_in` as a group by uid, cumulate(PROCTIME(), interval '1' minute, interval '1' hour);
>
>
> hello, 各位大佬, flink 1.13.0 中流式作业中该怎么使用cumulate window呢?我用上面的SQL 貌似是不行, 有没有使用过的大佬给点建议?
>
>
>
>
> | |
> 邹云鹤
> |
> |
> kevinyunhe@163.com
> |
> 签名由网易邮箱大师定制