pulsar-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [pulsar] sijie edited a comment on issue #3741: POJO AvroSchema always allowNull
Date Tue, 05 Mar 2019 06:19:37 GMT
sijie edited a comment on issue #3741: POJO AvroSchema always allowNull
URL: https://github.com/apache/pulsar/issues/3741#issuecomment-469554352
 
 
   @jerrypeng I got a different result than yours
   
   ```
           log.info("Pulsar AllowNull     :{}", new String(AvroSchema.of(User.class).getSchemaInfo().getSchema()));
   
           log.info("Avro AllowNull       :{}", ReflectData.AllowNull.get().getSchema(User.class));
   
           log.info("Avro Not AllowNull   :{}", ReflectData.get().getSchema(User.class));
     
   ```
   
   ```
   Pulsar AllowNull     :{"type":"record","name":"User","namespace":"example.avro","fields":[{"name":"name","type":["null","string"],"default":null},{"name":"favorite_number","type":["null","int"],"default":null},{"name":"favorite_color","type":["null","string"],"default":null},{"name":"age","type":"int"}]}
   Avro Not AllowNull   :{"type":"record","name":"User","namespace":"example.avro","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":"string"},{"name":"age","type":"int","default":19}]}
   Avro AllowNull       :{"type":"record","name":"User","namespace":"example.avro","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":"string"},{"name":"age","type":"int","default":19}]}
   ```
   
   
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message