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

Get last element as a table name from a topic name #339

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

IlyaTsoi
Copy link
Contributor

It would be better if it didn't depend on the hard-coded ..

template

It would be better if it didn't depend on the hard-coded <server>.<database>.<table> template
@aadant aadant requested a review from subkanthi October 25, 2023 04:22
@subkanthi
Copy link
Collaborator

DId you come across a bug for this, all the debezium connectors create topics in the following format.

<topicPrefix>.<schemaName>.<tableName>

Would be better to return a NULL table name instead of extracting a wrong table name and writing data to it.

@IlyaTsoi
Copy link
Contributor Author

IlyaTsoi commented Oct 25, 2023

In any case a table name is located at the end of the topic name. Isn't it? Current logic brakes when using topic.prefix in debezium config and we get null instead of table name. Of course topic2table mapping by regex will resolve this issue. My solution migth be used as workaround.

@IlyaTsoi
Copy link
Contributor Author

IlyaTsoi commented Nov 3, 2023

@subkanthi one more argument): when getTableNameFromTopic() returns null the table with this name will be created and the table will contain all columns from all source tables). Of course, replication will fail. I have not inspected why, but seen such behavior.

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.

2 participants