[ 
https://issues.apache.org/jira/browse/FLINK-41611?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Timo Theusner updated FLINK-41611:
----------------------------------
    Release Note: CREATE OR ALTER MATERIALIZED TABLE and ALTER MATERIALIZED 
TABLE ... AS now reject a query change that moves an existing persisted column. 
Before, a typed column list that inserted a column between existing ones was 
accepted, but the column was appended to the end of the table while the refresh 
job kept writing in query order, so values landed in the wrong columns. 
Re-running the statement of a table created this way now fails with "When 
modifying the query of a materialized table, currently only support appending 
columns at the end of original schema ...". To fix such a table, run ALTER 
MATERIALIZED TABLE ... AS with the query's columns in the table's order. Rows 
written before the fix stay misaligned.

> Allow only appending columns at the end when a materialized table's query 
> changes
> ---------------------------------------------------------------------------------
>
>                 Key: FLINK-41611
>                 URL: https://issues.apache.org/jira/browse/FLINK-41611
>             Project: Flink
>          Issue Type: Bug
>          Components: Table SQL / Planner
>            Reporter: Timo Theusner
>            Assignee: Timo Theusner
>            Priority: Major
>              Labels: pull-request-available
>
> {{CREATE OR ALTER}} and {{ALTER ... AS}} accept a query that inserts a column 
> and reorders existing ones: {{SELECT a, b, c}} → {{SELECT a, x, c, b}} stores 
> {{(a, c, b, x)}} while the positional refresh writes {{(a, x, c, b)}}, so 
> values land in wrong columns. {{validateAndExtractColumnChanges}} compares 
> positions on different scales, and {{validateChanges}} checks each change 
> alone. FLIP-492 and FLIP-546 allow only appending at the end.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to