Tous les produits
Search
Centre de documentation

Realtime Compute for Apache Flink:UNION ALL

Dernière mise à jour :Aug 19, 2026

Cette rubrique explique comment la compatibilité entre un déploiement et les données d'état est affectée lorsque vous modifiez l'opérateur UNION ALL dans une instruction SQL associée au déploiement.

Modifications n'affectant pas ou affectant partiellement la compatibilité

Modifiez l'ordre des requêtes d'entrée dans l'opérateur UNION ALL. Cette modification n'affecte pas la compatibilité des données d'état pour les opérateurs avec état en aval.

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

-- Original SQL statement: 
select a, sum(b), max(c) from (
  select a, b, c from MyTable union all select a, b, c from MyTable2
) group by a;

-- Change the order of input queries in UNION ALL. After this modification, the deployment remains fully compatible with the state data. 
select a, sum(b), max(c) from (
  select a, b, c from MyTable2 union all select a, b, c from MyTable
) group by a;

Modifications entraînant une incompatibilité totale

Ajoutez ou supprimez une requête d'entrée dans l'opérateur UNION ALL. Cette modification rend les données d'état incompatibles pour les opérateurs avec état en aval.

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

-- Original SQL statement: 
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
);

-- Add an input query to UNION ALL. After this modification, the deployment becomes incompatible with the state data. 
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;