shan-96 commented on issue #3115: JSONSchema should works with generic 
(parameterized type) POJO/DTO.
URL: https://github.com/apache/pulsar/issues/3115#issuecomment-585779361
 
 
   @vamsi360 
   
   We are trying to write to Avro Files using version 1.8.3-ppe-9.10
   
   We are writing a java object from memory to a specified file using 
`DataFileWriter`.
   While building the schema of the POJO at runtime, we call...
   ```
   private static Schema getJsonSchema(Class c) {
       Schema s = ReflectData.AllowNull.get().getSchema(c);
       AvroSchema avroSchema = new AvroSchema(s);
       return avroSchema.getAvroSchema();
     }
   ```
   However, we still get the same exception as mentioned above which we got 
through maven released version of Avro (1.8)
   
   Our schema (POJO) looks like this:
   ```
   public RawData extends Data<String>{
       private static final long serialVersionUID = 1L;
       private long field 1;
       private String field 2;
   }
   
   public abstract class Data<T> implements Serializable {
       private static final long serialVersionUID = 1L;
       private String dataType;
       private T id;
   }
   ```
   
   We want to define `AvroSchema `for `RawData.class`
   
   cc: @rohts-patil 

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