raminqaf commented on code in PR #29968:
URL: https://github.com/apache/flink/pull/29968#discussion_r4587233078


##########
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:
   So if the table has already a partition, we ignore the `PARTITION BY` 
clause. Why not fail instead? Wouldn't silently ignoring not very confusing for 
the end user?



-- 
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