Skip to content
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

[flink] kafka_sync_database supports different prefix and suffix for different db #4704

Merged
merged 2 commits into from
Dec 15, 2024

Conversation

JackeyLee007
Copy link
Contributor

Purpose

Linked issue: close #4703

With kafka_sync_database, user can specify different prefix and suffix for different db.

Tests

org.apache.paimon.flink.action.cdc.TableNameConverterTest#testConvertTableNameByDBPrefix_Suffix

API and Format

No

Documentation

Yes and provided.

@@ -143,7 +143,8 @@ protected void beforeBuildingSourceSink() throws Exception {
for (JdbcTableInfo tableInfo : jdbcTableInfos) {
Identifier identifier =
Identifier.create(
database, tableNameConverter.convert(tableInfo.toPaimonTableName()));
database,
tableNameConverter.convert("", tableInfo.toPaimonTableName()));
Copy link
Contributor

Choose a reason for hiding this comment

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

database?

Copy link
Contributor Author

@JackeyLee007 JackeyLee007 Dec 14, 2024

Choose a reason for hiding this comment

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

Actually, I changed nothing but supply default value for the first argument of the "convert" method.
In this context, the prefix and suffix are not specified by database, so it's ok to provide an empty string as the argument value.

@@ -529,6 +529,7 @@ under the License.
<exclude>release/**</exclude>
<!-- antlr grammar files -->
<exclude>paimon-common/src/main/antlr4/**</exclude>
<exclude>paimon-core/src/test/resources/compatibility/**</exclude>
Copy link
Contributor

Choose a reason for hiding this comment

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

why add this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If not, the rat-plugin always report license warning when building locally as the following:
[WARNING] Files with unapproved licenses:
paimon-core/src/test/resources/compatibility/datasplit-v1
paimon-core/src/test/resources/compatibility/datasplit-v2

@JingsongLi
Copy link
Contributor

+1

@JingsongLi JingsongLi merged commit d61f3d2 into apache:master Dec 15, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants