You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/12/07 08:16:56 UTC

[GitHub] [pulsar] JacekWislicki commented on issue #18501: [Bug] Incompatible schema when having Avro schema without nullable string fields

JacekWislicki commented on issue #18501:
URL: https://github.com/apache/pulsar/issues/18501#issuecomment-1340565703

   Just a couple of words of what we noticed:
   
   When defining the schema for a Pulsar client, this code makes a schema with everything nullable:
   `Schema.AVRO(MyClass.class)`
   However, the Avro API supports non-nullable fields and the above can be written as:
   `DefaultImplementation.getDefaultImplementation().newAvroSchema(SchemaDefinition.builder().withAlwaysAllowNull(false).withPojo(MyClass.class).build())`
   Though, there does not seem to be any configuration to enforce "alwaysAllowNull=false" in Pulsar functions/sinks.
   
   Additionally, "pulsar-admin schemas extract" has the --always-allow-null flag allowing toggling generation of a schema with non-nullable fields.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org