Handle empty strings for nullable UUID columns - #788
Draft
KSHITIZ6341 wants to merge 1 commit into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #479
Debezium delete records can carry UUID-backed string fields as empty strings. The RowBinary writer treated the value as non-null before calling
UUID.fromString(""), which then failed before the record could be inserted into aNullable(UUID)column.This change encodes an empty string as
NULLonly when the destination column isNullable(UUID). It covers both RowBinary and RowBinaryWithDefaults while preserving the existing rejection of empty values for non-nullable UUID columns.Good catch, @DmitryTuryshev. Confirming that the destination column is
Nullable(UUID)made the intended behavior clear.Compatibility
There are no configuration or API changes. Valid UUID serialization is unchanged, and empty strings remain invalid for non-nullable UUID columns.
Validation
./gradlew clean test --tests 'com.clickhouse.kafka.connect.sink.db.ClickHouseWriterSerializationTest' --tests 'com.clickhouse.kafka.connect.sink.db.mapping.ColumnTest' --tests 'com.clickhouse.kafka.connect.sink.data.convert.DebeziumRecordConvertorTest' --no-daemon(58 tests passed)./gradlew spotlessApply spotlessCheck --no-daemonNot run locally:
./gradlew clean test: the container-backed suite requires a Docker daemon, which was unavailable locally../gradlew clean integrationTest: requires the container environment and ClickHouse Cloud credentials.Checklist
CHANGELOG.md