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] parse primary key and schema by historyRecord #1621

Merged
merged 1 commit into from
Jul 24, 2023

Conversation

zhangjun0x01
Copy link
Contributor

Purpose

Linked issue: close #1613

Tests

API and Format

Documentation

Copy link
Contributor

@yuzelin yuzelin left a comment

Choose a reason for hiding this comment

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

Thanks for contributing~ Left some comments.

Comment on lines 237 to 238
if (!tableChanges
.get(0)
Copy link
Contributor

Choose a reason for hiding this comment

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

Too many tableChanges.get(0).
You can use a variable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I update it

String id = tableChanges.get(0).get("id").asText();
String tableName = id.replaceAll("\"", "").split("\\.")[1];
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's OK to use id in LOG.debug.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, when I write other PR (#1282), sync multiple mysql database to paimon, we need to distinguish tables with the same name under different databases, so we need to use the format of dbName.tableName. I will update the format in that PR.

precision,
scale,
MYSQL_CONVERTER_TINYINT1_BOOL.defaultValue())
.copy(element.get("optional").asBoolean()));
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not familiar with debezium json, I want to know here can we find field comments? If we can, we should also get the comments.

Copy link
Contributor Author

@zhangjun0x01 zhangjun0x01 Jul 21, 2023

Choose a reason for hiding this comment

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

the new version debezium history record contains the table comment and column comment,I add TODO, when we upgrade to flink cdc 2.4 , we can add the comment

Copy link
Contributor

Choose a reason for hiding this comment

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

cool~

Copy link
Contributor Author

Choose a reason for hiding this comment

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

new version debezium history record also contains the column default value , we can sync it also.

@zhangjun0x01 zhangjun0x01 force-pushed the parse_by_history_record branch from 63a6468 to 00defaa Compare July 21, 2023 14:37
@zhangjun0x01 zhangjun0x01 force-pushed the parse_by_history_record branch from c4705b4 to 6ad0973 Compare July 22, 2023 03:51
Copy link
Contributor

@JingsongLi JingsongLi left a comment

Choose a reason for hiding this comment

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

+1

@JingsongLi JingsongLi merged commit ba02730 into apache:master Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants