Skip to content

[kv] Support first row merge engine#240

Merged
wuchong merged 4 commits intoapache:mainfrom
luoyuxia:support-first-row-merge-engin
Jan 5, 2025
Merged

[kv] Support first row merge engine#240
wuchong merged 4 commits intoapache:mainfrom
luoyuxia:support-first-row-merge-engin

Conversation

@luoyuxia
Copy link
Copy Markdown
Contributor

@luoyuxia luoyuxia commented Dec 20, 2024

Purpose

Linked issue: close #133

Introduce first row merge engine for primary key table

Tests

FlussTableITCase#testFirstRowMergeEngine
FlinkTableSinkITCase#testFirstRowMergeEngine

API and Format

N/A

Documentation

I'd like to complete the document in another pr #241 since after introduce merge engine, we may need to refactor the document struture about primary key table.

Copy link
Copy Markdown
Member

@wuchong wuchong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need add validations for FlinkTableSink that first_row table doesn't supports UPDATE/DELETE and partial-update! And add tests to verify that.

Comment thread fluss-client/src/test/java/com/alibaba/fluss/client/table/FlussTableITCase.java Outdated
@luoyuxia
Copy link
Copy Markdown
Contributor Author

@wuchong Comments addressed...

if (mergeEngine != null && mergeEngine == ConfigOptions.MergeEngine.FIRST_ROW) {
throw new UnsupportedOperationException(
String.format(
"Table %s is with merge engine '%s'. Table with '%s' merge engine doesn't support DELETE and UPDATE statements.",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Table xxx uses the 'first_row' merge engine, which does not support DELETE or UPDATE statements.

}

@Test
void testUnsupportedDeleteAndUpdateStmtOnFirstRowMergeEngine() {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

verify partial update as well!

Comment on lines +149 to +151
key(ConfigOptions.TABLE_MERGE_ENGINE.key())
.enumType(ConfigOptions.MergeEngine.class)
.noDefaultValue());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reuse the definition?

@luoyuxia luoyuxia force-pushed the support-first-row-merge-engin branch from e64b962 to 9de11b8 Compare December 24, 2024 08:15
@luoyuxia
Copy link
Copy Markdown
Contributor Author

@wuchong Comments addressed again...

@wuchong wuchong force-pushed the support-first-row-merge-engin branch from 9de11b8 to 1353756 Compare January 5, 2025 14:45
Copy link
Copy Markdown
Member

@wuchong wuchong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. @luoyuxia I appended a commit to improve the config operations:

  1. Move MergeEngine out of ConfigOptions, as it is very widely used in the code base, just like KvFormat.
  2. use toFlinkOption for quick/easy conversion from Fluss ConfigOption to Flink ConfigOption, avoid duplicate definition in FlinkTableFactory.

@wuchong
Copy link
Copy Markdown
Member

wuchong commented Jan 5, 2025

The CI is passed. I will merge it...

@luoyuxia please check the commit I appended.

1 similar comment
@wuchong
Copy link
Copy Markdown
Member

wuchong commented Jan 5, 2025

The CI is passed. I will merge it...

@luoyuxia please check the commit I appended.

@wuchong wuchong merged commit 92c6d23 into apache:main Jan 5, 2025
ZmmBigdata pushed a commit to ZmmBigdata/fluss that referenced this pull request Jun 20, 2025
Ugbot pushed a commit to Ugbot/fluss that referenced this pull request Apr 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Introduce first-row merge engine for primary key table

3 participants