You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Mickael Maison (Jira)" <ji...@apache.org> on 2026/01/07 17:49:00 UTC
[jira] [Resolved] (KAFKA-20020) Improve UUID nullability description in API readme
[ https://issues.apache.org/jira/browse/KAFKA-20020?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mickael Maison resolved KAFKA-20020.
------------------------------------
Fix Version/s: 4.3.0
Resolution: Fixed
> Improve UUID nullability description in API readme
> --------------------------------------------------
>
> Key: KAFKA-20020
> URL: https://issues.apache.org/jira/browse/KAFKA-20020
> Project: Kafka
> Issue Type: Bug
> Components: documentation
> Affects Versions: 4.1.1
> Reporter: Federico Valeri
> Assignee: Federico Valeri
> Priority: Major
> Fix For: 4.3.0
>
>
> The Nullable Fields section in the Kafka message protocol readme can make people think that they can declare nullable a field of type Uuid:
> {code}
> Booleans, ints, and floats can never be null. However, fields that are strings,
> bytes, uuid, records, or arrays may optionally be "nullable". When a field is
> "nullable", that simply means that we are prepared to serialize and deserialize
> null entries for that field.
> ...
> If a field is declared as non-nullable, and it is present in the message
> version you are using, you should set it to a non-null value before serializing
> the message. Otherwise, you will get a runtime error.
> {code}
> This is not possible by design as the UUIDFieldType class does NOT override canBeNullable(), so it inherits the default implementation which returns false. Uuid fields use a special zero uuid value (all bits set to 0) as a sentinel to represent "no UUID" instead of null.
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)