Is it possible to serialize schemaless object?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Is it possible to serialize schemaless object?

I am able to serialize and deserialize object into Avro that contains schema. However, when trying to test passing a plain java object in order to convert that object to bytes arrary. It throws Not a Specific class exception.

org.apache.avro.AvroRuntimeException: org.apache.avro.AvroRuntimeException: Not a Specific class
   at org.apache.avro.specific.SpecificData.getSchema(
   at org.apache.avro.specific.SpecificDatumWriter.<init>(

The code used to serialize object is based on except the record is not an instance of SpecificRecord. 

Does that mean user can only serialize object with schema provided because it will need to obtain schema (SpecificData line 227)? Is there any alternative ways to serialize object without schema?