Renaming a column alias in a Flink SQL statement does not affect the compatibility between a deployment and its state data. The deployment continues to run without interruption, and no state migration is required.
Note
This page covers alias changes only within the deployment's own SQL statement. The impact on downstream queries that consume the output of this deployment is not covered here.
Change a column alias
To rename a column alias without breaking state compatibility, rewrite the query using a subquery that assigns the new alias, then reference the new alias in the outer query.
The following example renames alias a to a1:
-- Original SQL statement:
select a, sum(b), max(c) from MyTable group by a;
-- Change alias a to a1.
-- After this modification, the deployment remains fully compatible with the state data.
select a1, sum(b), max(c) from (select a as a1, b, c from MyTable) group by a1;