Timm0 commented on PR #30156:
URL: https://github.com/apache/flink/pull/30156#issuecomment-7215362057

   > The logic looks right to me. Applying the emitted changes reproduces the 
target persisted order, and checking the built table closes the two holes the 
per-change check had: moving a column behind the last existing one, and 
reorders through a typed column list.
   > 
   > One behavior change is worth a line in the description. An MT whose stored 
order already differs from its query can no longer be re-applied unchanged. 
Example: created before this fix through a typed column list with an insert in 
the middle, so the table is `(a, b, c, x)` while the query is `SELECT a, x, b, 
c`. Re-running the same `CREATE OR ALTER` used to be a no-op. Now the typed 
list emits `x AFTER a`, and validation rejects it. I think rejecting is 
acceptable since that table is already misaligned, but the way out should be 
documented: `ALTER ... AS` with the query in table order.
   > 
   > This conflicts textually with 
[#30155](https://github.com/apache/flink/pull/30155) in 
`SqlNodeToOperationSqlCreateOrAlterMaterializedTableConverterTest`, so 
whichever lands second needs a rebase.
   > 
   > `ALTER MATERIALIZED TABLE ... MODIFY ... FIRST/AFTER` still moves 
persisted columns without touching the query. That's 
[FLINK-41679](https://issues.apache.org/jira/browse/FLINK-41679), right?
   
   I added a "Behavior change" section to the description and the Jira release 
note, with `ALTER ... AS` in table order as the way out.
   Regarding `MODIFY ... FIRST/AFTER`, this is still an open point where 
re-ordering can happen, you are right that FLINK-41679 covers it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to