Skip to content

Handle empty strings for nullable UUID columns - #788

Draft
KSHITIZ6341 wants to merge 1 commit into
ClickHouse:mainfrom
KSHITIZ6341:fix/nullable-empty-uuid
Draft

Handle empty strings for nullable UUID columns#788
KSHITIZ6341 wants to merge 1 commit into
ClickHouse:mainfrom
KSHITIZ6341:fix/nullable-empty-uuid

Conversation

@KSHITIZ6341

Copy link
Copy Markdown

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 a Nullable(UUID) column.

This change encodes an empty string as NULL only when the destination column is Nullable(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-daemon

Not run locally:

  • Full ./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

  • Unit tests covering both RowBinary modes and the non-nullable compatibility case were added
  • A human-readable description of the changes was provided in CHANGELOG.md

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.

If a UUID with an empty string is error exception

1 participant