This repository has been archived by the owner on Apr 1, 2024. It is now read-only.
ISSUE-15655: [Doc] SchemaDefinition must be used to create Avro schema in a certain case #4234
Open
1 task done
Labels
Original Issue: apache#15655
What issue do you find in Pulsar docs?
Currently Pulsar docs only shows a simple way to create Avro schema. See https://pulsar.apache.org/docs/next/schema-understand#usage.
Given the following
User
class:We can create an producer with Avro schema like:
However, if the class has a nullable field with a default value like:
We must create the Avro schema via a
SchemaDefinition
and disable thealwaysAllowNull
field like:Otherwise, the schema info would be invalid. Run following test to reproduce:
The 2nd creation of the producer will fail with following error messages:
What is your suggestion?
SchemaDefinition
.Do you have any references?
https://pulsar.apache.org/docs/next/schema-understand#usage
Would you like to fix this issue?
Yes
Note
The text was updated successfully, but these errors were encountered: