gustavodemorais commented on code in PR #30182:
URL: https://github.com/apache/flink/pull/30182#discussion_r4772007178


##########
docs/content.zh/docs/sql/reference/queries/deduplication.md:
##########
@@ -234,6 +241,61 @@ GROUP BY window_start, window_end;
 
 The repeated `e1` is not counted. The first copy of a row is kept even if it 
arrives late, so a later window can drop it.
 
+#### Updating input with one row per key
+
+A CDC table with primary key `customer_id`, partitioned by its primary key:
+
+| `customers_cdc`          |
+|:-------------------------|
+| `+I(c1, Berlin, 100)`    |
+| `+U(c1, Munich, 120)`    |
+| `+U(c1, Hamburg, 110)`   |
+| `-D(c1)`                 |
+| `+U(c1, Bremen, 115)`    |
+
+```sql
+SELECT * FROM DEDUPLICATE(
+  input => TABLE customers_cdc PARTITION BY customer_id,
+  keep => 'last',
+  sequence_by => DESCRIPTOR(lsn))
+```
+
+| Changes of the result    |                            |
+|:-------------------------|:---------------------------|
+| `+I(c1, Berlin, 100)`    |                            |
+| `+U(c1, Munich, 120)`    |                            |
+| `+U(c1, Hamburg, 110)`   | `sequence_by` → no effect  |
+| `-D(c1, Hamburg, 110)`   | full row, not only the key |
+| `+I(c1, Bremen, 115)`    | no state → first record    |
+
+To discard versions of a row that arrive out of order, deduplicate the change 
events as an append-only table, as in [Order by a column](#order-by-a-column).
+

Review Comment:
   With one row per key `DEDUPLICATE` returns the input as is, so this example 
mostly shows change flags. The out-of-order note fits better in the "Updating 
input" section above, so could we drop this example? (same in the English copy)
   
   ```suggestion
   ```



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