【PipelineDB】实时流统计

340 阅读1分钟

概述

pipelinedb的用法非常简单,首先定义stream(流),然后基于stream定义对应的transform(事件触发模块),以及Continuous Views(实时统计模块)数据往流里面插入,transform和Continuous Views就在后面实时的对流里的数据进行处理 官方文档

分类

1 Continuous Views

  • 语法
CREATE VIEW name [WITH (action=materialize [, ...])]  AS query
  • 用例
CREATE VIEW continuous_v2 WITH (action=materialize) AS    
SELECT create_date,count(tx_ryt),zhan_dian
FROM streams_page GROUP BY zhan_dian,create_date;  

2 Continuous Transforms

  • 语法
CREATE VIEW name [WITH (action=materialize [, ...])]  AS query
  • 用例
CREATE VIEW continuous_v2 WITH (action=materialize) AS    
SELECT create_date,count(tx_ryt),zhan_dian
FROM streams_page GROUP BY zhan_dian,create_date;  

3 Streams

  • 语法
CREATE VIEW name [WITH (action=materialize [, ...])]  AS query
  • 用例
CREATE VIEW continuous_v2 WITH (action=materialize) AS    
SELECT create_date,count(tx_ryt),zhan_dian
FROM streams_page GROUP BY zhan_dian,create_date;