Union All

更新时间: 2024-06-05 17:11:57

本文为您介绍Union All变更的可兼容性和不可兼容性详情。

可兼容的变更

调整Union All的输入Query的顺序,对下游有状态算子属于完全兼容变更。

create table MyTable2 (
  a int,
  b bigint,
  c varchar,
  d int
);

-- 原始SQL。
select a, sum(b), max(c) from (
  select a, b, c from MyTable union all select a, b, c from MyTable2
) group by a;


--调整Union All的输入Query的顺序,该修改属于完全兼容修改。
select a, sum(b), max(c) from (
  select a, b, c from MyTable2 union all select a, b, c from MyTable
) group by a;

不兼容的变更

添加或删除Union All的输入Query,对下游有状态算子属于不兼容性变更。

create table MyTable2 (
  a int,
  b bigint,
  c varchar,
  d int
);

-- 原始SQL。
select a, sum(b), max(c) from (
  select a, b, c from MyTable union all select a, b, c from MyTable2
) group by a;

create table MyTable3 (
  a int,
  b bigint,
  c varchar,
  d int
);

-- 添加Union All的输入Query,该修改属于不兼容修改。
select a, sum(b), max(c) from (
  select a, b, c from MyTable
  union all
  select a, b, c from MyTable2
  union all
  select a, b, c from MyTable3
) group by a;
上一篇: SQL修改及兼容性 下一篇: 变更Source
阿里云首页 实时计算 Flink版 相关技术圈