jerrypeng edited a comment on issue #3741: POJO AvroSchema always allowNull
URL: https://github.com/apache/pulsar/issues/3741#issuecomment-469565479
 
 
   @sijie yup though I am not sure setting AllowNull is producing an 
incompatible schema.  Incompatible to what?  I guess if a user wrote some code:
   
   ```
   ReflectData.get().getSchema(MyClass.class)
   ```
   
   and they didn't set allow null then it wouldn't be compatible with the 
current schema generated from AvroSchema but my implementation could just have 
easily set allow null.   Thus, this doesn't seem like big deal and arbitrary. 
   
   However in Java, classes can be null and primitives cannot be.  Should we 
not preserve that semantic?  Is ```Integer``` the same as ```int```? e.g. 
should the following class:
   
   ```
    public static class Foo {
           int field1;
   }
   ```
   generate the same AVRO schema as
   
   ```
    public static class Foo {
           Integer field1;
   ```
   ?
   
   I am fine with removing AllowNull by default  if everyone wants to do it but 
I think the bigger problem here is the one with shading and how generated java 
classes are handled since that is a API/standard that should work across 
systems.

----------------------------------------------------------------
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

Reply via email to