jerrypeng commented on issue #3741: POJO AvroSchema always allowNull URL: https://github.com/apache/pulsar/issues/3741#issuecomment-469488859 > The point here for a given POJO, Pulsar should maintain a basic contract: the schema generated by > Pulsar AVRO should be same/compatible with what other tools generated. Pulsar AVRO should not > > automatically attach AllowNull for all fields, otherwise we shouldn't call it AVRO schema, we should > > be calling it AlwaysAllowNullAvroSchema. @sijie the contract you are creating when generating an avro schema using the ReflectData api is with the java class itself not some other tool or system. If you want to provide a custom schema, we should have the way to do so. These issues are connected. Like I mentioned before, a user can create a Avro schema file with arbitrary fields set to null. There is not way to get such information from a java class along. Thus, the api currently does not suffice for general use cases when users are bring in generic avro schemas irregardless of whether allowNull is set by default. To summarize, we can NOT set allowNull by default but it hardly solves the underlying issue.
---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
