Timm0 commented on code in PR #29968: URL: https://github.com/apache/flink/pull/29968#discussion_r4587631208
########## docs/content/docs/sql/materialized-table/statements.md: ########## @@ -365,7 +365,11 @@ CREATE OR ALTER MATERIALIZED TABLE user_spending ( -- columns: total_doubled, user_id, total_amount (primary key: user_id) ``` -Because the schema, primary key, and watermark all come from the statement and its query, not from the existing table, the result is fully defined by the DDL. The same statement always produces the same materialized table. Running it again after the conversion matches the now-existing materialized table and produces the same result. +Because the schema, primary key, and watermark all come from the statement and its query, not from the existing table, they are fully defined by the DDL. Running the statement again after the conversion matches the now-existing materialized table and produces the same result. + +**Partition keys** + +A partitioned table keeps its partition keys, so the data it already holds still matches them. A `PARTITIONED BY` clause in the statement is then ignored, and the query must produce the partition columns. An unpartitioned table takes the partition keys from the statement's `PARTITIONED BY` clause. Running the statement again alters the now-existing materialized table, so list the table's partition keys in `PARTITIONED BY`, in the same order, to keep them. Review Comment: Changed the behavior to fail instead. I also created FLINK-41520 for adjusting the `CREATE OR ALTER` path to use the same semantics. -- 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]
