You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/docs/table-design/table-types/pk-table/merge-engines/versioned.md
+79-1Lines changed: 79 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,4 +5,82 @@ sidebar_position: 3
5
5
6
6
# Versioned Merge Engine
7
7
8
-
TODO: Fill me #459
8
+
The **Versioned Merge Engine** enables data updates based on version numbers or event timestamps. It ensures that only the row with the highest version number (or event timestamp) for a given primary key is retained. This mechanism is particularly useful for deduplicating or merging out-of-order data while guaranteeing eventual consistency with the upstream source.
9
+
10
+
By setting `'table.merge-engine' = 'versioned'`, users can update data based on a configured version column. Updates are performed when the latest value of the specified field is greater than or equal to the stored value. If the incoming value is less than the stored value or is null, no update will occur.
11
+
12
+
This feature is especially valuable as a replacement for [Deduplication](https://nightlies.apache.org/flink/flink-docs-release-1.20/docs/dev/table/sql/queries/deduplication/) transformations in streaming computations. It simplifies workflows, reduces complexity, and improves overall efficiency.
13
+
14
+
15
+
:::note
16
+
When using the `versioned` merge engine, keep the following limitations in mind:
17
+
-**`UPDATE` and `DELETE` statements are not supported.**
18
+
-**Partial updates are not supported.**
19
+
-**`UPDATE_BEFORE` and `DELETE` changelog events are ignored automatically.**
20
+
:::
21
+
22
+
### Version Column
23
+
24
+
The version column is a column in the table that stores the version number (or event timestamp) of the data record.
25
+
When enabling the versioned merge engine, the version column must be explicitly specified using the property:
0 commit comments