-
Notifications
You must be signed in to change notification settings - Fork 460
Add document about versioned merge engine #523
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| -- | 1 | v2 | 2000 | | ||
|
|
||
| -- insert data with ts = null, no update will be made | ||
| nsert into merge_engine_with_version ( a,b,ts ) VALUES (1, 'v2', null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: nsert -> insert.
| -- | a | b | ts | | ||
| -- +---+-----+------+ | ||
| -- | 1 | v2 | 2000 | | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add -- +---+-----+------+ in table end.
| -- | a | b | ts | | ||
| -- +---+-----+------+ | ||
| -- | 1 | v2 | 2000 | | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above.
luoyuxia
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sunxiaojian Thanks for the pr. PTAL
| ::: | ||
|
|
||
| example: | ||
| ```sql title="versioned" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ```sql title="versioned" | |
| ```sql title="Flink SQL" |
| 'table.merge-engine' = 'versioned', | ||
| 'table.merge-engine.versioned.ver-column' = 'ts' | ||
| ); | ||
| insert into merge_engine_with_version ( a,b,ts ) VALUES (1, 'v1', 1000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
| insert into merge_engine_with_version ( a,b,ts ) VALUES (1, 'v1', 1000); | |
| insert into merge_engine_with_version (a, b, ts ) VALUES (1, 'v1', 1000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@luoyuxia Whether to remove the space after ts?
(a, b, ts ) -> (a, b, ts)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't noticed that
| insert into merge_engine_with_version ( a,b,ts ) VALUES (1, 'v1', 1000); | ||
|
|
||
| -- insert data with ts < 1000, no update will be made | ||
| insert into merge_engine_with_version ( a,b,ts ) VALUES (1, 'v2', 999); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
| insert into merge_engine_with_version ( a,b,ts ) VALUES (1, 'v2', 999); | |
| insert into merge_engine_with_version (a, b, ts ) VALUES (1, 'v2', 999); |
|
|
||
|
|
||
| -- insert data with ts > 1000, update will be made | ||
| insert into merge_engine_with_version ( a,b,ts ) VALUES (1, 'v2', 2000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit
| insert into merge_engine_with_version ( a,b,ts ) VALUES (1, 'v2', 2000); | |
| insert into merge_engine_with_version (a, b, ts ) VALUES (1, 'v2', 2000); |
| -- | a | b | ts | | ||
| -- +---+-----+------+ | ||
| -- | 1 | v2 | 2000 | | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: add the bottom line to align with the style of above content
-- +---+-----+------+
-- | a | b | ts |
-- +---+-----+------+
-- | 1 | v2 | 2000 |
-- +---+-----+------+
| When using `versioned` merge engine, there are the following limits: | ||
| - `UPDATE` and `DELETE` statements are not supported | ||
| - Partial update is not supported | ||
| ::: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ::: | |
| ::: |
| :::note | ||
| When using `versioned` merge engine, there are the following limits: | ||
| - `UPDATE` and `DELETE` statements are not supported | ||
| - Partial update is not supported |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add one more note just like first-row merge engine:
`UPDATE_BEFORE` and `DELETE` changelog events are ignored automatically
| # Versioned Merge Engine | ||
|
|
||
| TODO: Fill me #459 | ||
| By specifying `'table.merge-engine' = 'versioned'`, users can update data based on the configured version column. Updates will be carried out when the latest value of the specified field is greater than the stored value. If it is less than or empty, no update will be made. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
| By specifying `'table.merge-engine' = 'versioned'`, users can update data based on the configured version column. Updates will be carried out when the latest value of the specified field is greater than the stored value. If it is less than or empty, no update will be made. | |
| By setting `'table.merge-engine' = 'versioned'`, users can update data based on the configured version column. Updates will be carried out when the latest value of the specified field is greater than or equal to the stored value. If it is less than or null, no update will be made. |
|
|
||
| TODO: Fill me #459 | ||
| By specifying `'table.merge-engine' = 'versioned'`, users can update data based on the configured version column. Updates will be carried out when the latest value of the specified field is greater than the stored value. If it is less than or empty, no update will be made. | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to suggest to add a statement to explain how the feature is useful just like first-row merge page does, maybe something like:
This feature is particularly valuable for replacing [Deduplication](https://nightlies.apache.org/flink/flink-docs-release-1.20/docs/dev/table/sql/queries/deduplication/) transformations in streaming computations, reducing complexity and improving overall efficiency.
| example: | ||
| ```sql title="versioned" | ||
|
|
||
| create table merge_engine_with_version ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please change SQL keyword to uppercase to align the style of first-row merge engine page?
|
@luoyuxia fixed |
7b8ef36 to
2296af8
Compare
2296af8 to
f26743c
Compare
luoyuxia
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @sunxiaojian LGTM. @wuchong Could you please help review agian?
Purpose
Linked issue: close #459
Tests
N/A
API and Format
N/A
Documentation
N/A