Skip to content

fix: prevent exception caused by adding duplicate fields in schema generation#195

Merged
Emrehzl94 merged 2 commits intoneo4j:mainfrom
Emrehzl94:cdc-schema-same-key
Oct 18, 2024
Merged

fix: prevent exception caused by adding duplicate fields in schema generation#195
Emrehzl94 merged 2 commits intoneo4j:mainfrom
Emrehzl94:cdc-schema-same-key

Conversation

@Emrehzl94
Copy link
Contributor

This PR fixes an issue where duplicate fields in the ChangeEvent schema generation process were causing org.apache.kafka.connect.errors.SchemaBuilderException: Cannot create field because of field name duplication id exception. When building the schema for key array elements, if different maps contained the same field name, the field was being added multiple times, resulting in the exception.

@Emrehzl94 Emrehzl94 requested a review from a team as a code owner October 18, 2024 10:42
@Emrehzl94 Emrehzl94 merged commit c2d0767 into neo4j:main Oct 18, 2024
topics =
arrayOf(
CdcSourceTopic(
topic = "cdc", patterns = arrayOf(CdcSourceParam("(:TestSource)"))))))
Copy link
Contributor

Choose a reason for hiding this comment

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

quick q unrelated to the PR: can't the patterns attribute here just be an array of strings? the CdcSourceParam type seems a bit verbose to me here

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.

3 participants