flink sql中怎么表达窗口的提前触发或延迟触发

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

flink sql中怎么表达窗口的提前触发或延迟触发

苏 欣
Blink文档中有介绍到EMIT Strategy,可以用WITH DELAY '1' MINUTE BEFORE WATERMARK或者EMIT WITHOUT DELAY AFTER WATERMARK等类似的语法来控制窗口触发。
但是我使用这种语法作业运行就会报SQL解析错误,请问有没有办法可以在sql中实现控制窗口触发的操作?
Table result = tEnv.sqlQuery("select " +
                "count(*) " +
                "from dept group by tumble(crt_time, INTERVAL '10' SECOND) WITH DELAY '1' MINUTE BEFORE WATERMARK");
报错:
Exception in thread "main" org.apache.flink.table.api.SqlParserException:
************
ERR_ID:
     SQL-00120001
CAUSE:
     SQL parse failed:
     Encountered "WITH" at line 1, column 75.
     Was expecting one of:
         <EOF>
         "ORDER" ...
         "LIMIT" ...
         "OFFSET" ...
         "FETCH" ...
         "," ...

发送自 Windows 10 版邮件<https://go.microsoft.com/fwlink/?LinkId=550986>应用

Reply | Threaded
Open this post in threaded view
|

Re: flink sql中怎么表达窗口的提前触发或延迟触发

Benchao Li
目前社区的1.9版本的blink-planner在parser层面还不支持,可以通过全局config来配置:
table.exec.emit.early-fire.enabled
table.exec.emit.early-fire.delay

可以尝试一下。

苏 欣 <[hidden email]> 于2019年9月11日周三 上午11:45写道:

> Blink文档中有介绍到EMIT Strategy,可以用WITH DELAY '1' MINUTE BEFORE WATERMARK或者EMIT
> WITHOUT DELAY AFTER WATERMARK等类似的语法来控制窗口触发。
> 但是我使用这种语法作业运行就会报SQL解析错误,请问有没有办法可以在sql中实现控制窗口触发的操作?
> Table result = tEnv.sqlQuery("select " +
>                 "count(*) " +
>                 "from dept group by tumble(crt_time, INTERVAL '10' SECOND)
> WITH DELAY '1' MINUTE BEFORE WATERMARK");
> 报错:
> Exception in thread "main" org.apache.flink.table.api.SqlParserException:
> ************
> ERR_ID:
>      SQL-00120001
> CAUSE:
>      SQL parse failed:
>      Encountered "WITH" at line 1, column 75.
>      Was expecting one of:
>          <EOF>
>          "ORDER" ...
>          "LIMIT" ...
>          "OFFSET" ...
>          "FETCH" ...
>          "," ...
>
> 发送自 Windows 10 版邮件<https://go.microsoft.com/fwlink/?LinkId=550986>应用
>
>

--

Benchao Li
School of Electronics Engineering and Computer Science, Peking University
Tel:+86-15650713730
Email: [hidden email]; [hidden email]
Reply | Threaded
Open this post in threaded view
|

答复: flink sql中怎么表达窗口的提前触发或延迟触发

苏 欣
感谢大佬解答,对于处理窗口迟到数据的话是不是可以通过setIdleStateRetentionTime方法来设置?



发送自 Windows 10 版邮件<https://go.microsoft.com/fwlink/?LinkId=550986>应用



________________________________
发件人: Benchao Li <[hidden email]>
发送时间: Wednesday, September 11, 2019 6:38:44 PM
收件人: [hidden email] <[hidden email]>
主题: Re: flink sql中怎么表达窗口的提前触发或延迟触发

目前社区的1.9版本的blink-planner在parser层面还不支持,可以通过全局config来配置:
table.exec.emit.early-fire.enabled
table.exec.emit.early-fire.delay

可以尝试一下。

苏 欣 <[hidden email]> 于2019年9月11日周三 上午11:45写道:

> Blink文档中有介绍到EMIT Strategy,可以用WITH DELAY '1' MINUTE BEFORE WATERMARK或者EMIT
> WITHOUT DELAY AFTER WATERMARK等类似的语法来控制窗口触发。
> 但是我使用这种语法作业运行就会报SQL解析错误,请问有没有办法可以在sql中实现控制窗口触发的操作?
> Table result = tEnv.sqlQuery("select " +
>                 "count(*) " +
>                 "from dept group by tumble(crt_time, INTERVAL '10' SECOND)
> WITH DELAY '1' MINUTE BEFORE WATERMARK");
> 报错:
> Exception in thread "main" org.apache.flink.table.api.SqlParserException:
> ************
> ERR_ID:
>      SQL-00120001
> CAUSE:
>      SQL parse failed:
>      Encountered "WITH" at line 1, column 75.
>      Was expecting one of:
>          <EOF>
>          "ORDER" ...
>          "LIMIT" ...
>          "OFFSET" ...
>          "FETCH" ...
>          "," ...
>
> 发送自 Windows 10 版邮件<https://go.microsoft.com/fwlink/?LinkId=550986>应用
>
>

--

Benchao Li
School of Electronics Engineering and Computer Science, Peking University
Tel:+86-15650713730
Email: [hidden email]; [hidden email]