Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Unable to obtain execution plans for multiple insert statements #3088

Closed
2 of 3 tasks
Zzm0809 opened this issue Jan 29, 2024 · 1 comment
Closed
2 of 3 tasks
Labels
Bug Something isn't working

Comments

@Zzm0809
Copy link
Contributor

Zzm0809 commented Jan 29, 2024

Search before asking

  • I had searched in the issues and found no similar issues.

What happened

编写以下 sql

DROP TABLE IF EXISTS source_table3;
CREATE TABLE IF NOT EXISTS
  source_table3 (
    -- 订单id
    `order_id` BIGINT,
    --产品
    `product` BIGINT,
    --金额
    `amount` BIGINT,
    -- 支付时间
    `order_time` as CAST(CURRENT_TIMESTAMP AS TIMESTAMP(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;
DROP TABLE IF EXISTS sink_table5;

CREATE TABLE IF 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;
DROP TABLE IF EXISTS sink_table6;

CREATE TABLE IF 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;

点击检查 按钮, 发现 insert 语句 在一起执行了

image

What you expected to happen

应该拆分开

How to reproduce

输入 sql 点击检查

Anything else

No response

Version

dev

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@Zzm0809 Zzm0809 added Waiting for reply Waiting for reply Bug Something isn't working and removed Waiting for reply Waiting for reply labels Jan 29, 2024
@aiwenmo
Copy link
Contributor

aiwenmo commented Feb 3, 2024

This is correct because it defaults to a statement set.

@aiwenmo aiwenmo closed this as completed Feb 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants