You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had searched in the issues and found no similar issues.
What happened
编写以下 sql
DROPTABLE IF EXISTS source_table3;
CREATETABLEIF NOT EXISTS
source_table3 (
-- 订单id`order_id`BIGINT,
--产品`product`BIGINT,
--金额`amount`BIGINT,
-- 支付时间`order_time`as CAST(CURRENT_TIMESTAMPASTIMESTAMP(3)), -- `在这里插入代码片`--WATERMARK
WATERMARK FOR order_time AS order_time - INTERVAL '2' SECOND
)
WITH
(
'connector'='datagen',
'rows-per-second'='1',
'fields.order_id.min'='1',
'fields.order_id.max'='2',
'fields.amount.min'='1',
'fields.amount.max'='10',
'fields.product.min'='1',
'fields.product.max'='2'
);
-- SELECT * FROM source_table3 LIMIT 10;DROPTABLE IF EXISTS sink_table5;
CREATETABLEIF NOT EXISTS
sink_table5 (
--产品`product`BIGINT,
--金额`amount`BIGINT,
--支付时间`order_time`TIMESTAMP(3),
-- 1分钟时间聚合总数 `one_minute_sum`BIGINT
)
WITH
('connector'='print');
-- SELECT * FROM source_table3 LIMIT 10;DROPTABLE IF EXISTS sink_table6;
CREATETABLEIF NOT EXISTS
sink_table6 (
--产品`product`BIGINT,
--金额`amount`BIGINT,
--支付时间`order_time`TIMESTAMP(3),
-- 1分钟时间聚合总数 `one_minute_sum`BIGINT
)
WITH
('connector'='print');
INSERT INTO
sink_table5
SELECT
product,
amount,
order_time,
SUM(amount) OVER (
PARTITION BY
product
ORDER BY
order_time
RANGE BETWEEN INTERVAL '1' MINUTE PRECEDING
AND CURRENT ROW
) as one_minute_sum
FROM
source_table3;
INSERT INTO
sink_table6
SELECT
product,
amount,
order_time,
SUM(amount) OVER (
PARTITION BY
product
ORDER BY
order_time
RANGE BETWEEN INTERVAL '1' MINUTE PRECEDING
AND CURRENT ROW
) as one_minute_sum
FROM source_table3;
Search before asking
What happened
编写以下 sql
点击
检查
按钮, 发现 insert 语句 在一起执行了What you expected to happen
应该拆分开
How to reproduce
输入 sql 点击检查
Anything else
No response
Version
dev
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: