[
https://issues.apache.org/jira/browse/KAFKA-19634?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18023382#comment-18023382
]
Lan Ding commented on KAFKA-19634:
----------------------------------
Hi [~junrao],
I have a question regarding the nullability of Struct. Under what circumstances
could a Struct potentially be null?
Looking at the current implementation, a Struct holds a reference to a Schema,
and the Schema's isNullable() method returns false by default. This suggests
that Struct should not be nullable at all from a design perspective.
What confuses me is how this aligns with handling nullable structs at the
protocol level, especially when compared to other nullable types like
NullableString where null handling is embedded within the type definition
itself.
Could you help clarify if I'm missing something here? Looking forward to your
insights.
> document the encoding of nullable struct
> ----------------------------------------
>
> Key: KAFKA-19634
> URL: https://issues.apache.org/jira/browse/KAFKA-19634
> Project: Kafka
> Issue Type: Improvement
> Reporter: Jun Rao
> Assignee: Lan Ding
> Priority: Major
>
> In [https://kafka.apache.org/protocol#protocol_types,] we didn't specify the
> encoding of a struct. In particular, how a nullable struct is represented. We
> should document that if a struct is nullable, the first byte indicates
> whether is null and the rest of the bytes are the serialization of each field.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)