Hi, Jark , 看了你的文章,有一点不是很清楚。

基于 uv_per_10min 再根据分钟时间进行一次聚合,这样每10分钟只有一个点会存储在 Elasticsearch 中,对于
Elasticsearch 和 Kibana 可视化渲染的压力会小很多。

INSERT INTO cumulative_uv
SELECT time_str, MAX(uv)
FROM uv_per_10min
GROUP BY time_str;


怎么实现按分钟聚合?没有明显的窗口设置。有什么内在特性?


Jark Wu <[email protected]> 于2020年3月20日周五 上午12:25写道:

> Hi 你可以看下这篇文章是否满足的你需求:
>
> http://wuchong.me/blog/2020/02/25/demo-building-real-time-application-with-flink-sql
> #
> <http://wuchong.me/blog/2020/02/25/demo-building-real-time-application-with-flink-sql#>
> 统计一天每10分钟累计独立用户数
>
> Best,
> Jark
>
>
> On Thu, 19 Mar 2020 at 23:30, hiliuxg <[email protected]> wrote:
>
> > hi all:有这样子一个场景,我想通过每隔5分钟统计当日零点到当前5分钟的pv和uv,用批处理大概大概表达如下:
> > select&nbsp; &nbsp;
> > &nbsp;'2020-03-19' as dt ,&nbsp;&nbsp;
> > &nbsp;'2020-03-19 12:05:00'&nbsp; as etltime ,
> > &nbsp;count(1) as pv ,&nbsp;
> > &nbsp;count(distinct userid) as uv&nbsp;
> > from t_user_log&nbsp;
> > where&nbsp; logintime&nbsp; &gt;= '2020-03-19 00:00:00' and logintime <
> > '2020-03-19 12:05:00'&nbsp;
> >
> >
> > 这里,没法用flink sql 处理,当时这种场景又特别多,各位大神有好的方案处理吗?
>


-- 
**************************************
 tivanli
**************************************

回复