参考Apache Flink 官网CEP案例
--参考文档 https://nightlies.apache.org/flink/flink-docs-release-1.14/zh/docs/dev/table/sql/queries/match_recognize/
--模拟股票
CREATE TEMPORARY TABLE Ticker (
symbol BIGINT, --股票代号
price BIGINT, -- 股票价格
tax BIGINT, -- 应纳税额
`ts` AS localtimestamp,
WATERMARK wf FOR `ts` AS withOffset(`ts`, 1000)
) WITH (
'connector' = 'datagen',
-- optional options --
'rows-per-second'='5',
'fields.symbol.kind'='random', --无界数据流
'fields.symbol.min'='1',
'fields.symbol.max'='3',
'fields.price.min'='1',
'fields.price.max'='100',
'fields.tax.min'='1',
'fields.tax.max'='10'
);
CREATE TEMPORARY TABLE print_sink (
symbol BIGINT