avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tj5527 <tj5...@protonmail.com>
Subject Is it possible to serialize schemaless object?
Date Mon, 31 Jul 2017 16:23:32 GMT
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: avro.shaded.com.google.common.util.concurrent.UncheckedExecutionException:
org.apache.avro.AvroRuntimeException: Not a Specific class
at org.apache.avro.specific.SpecificData.getSchema(SpecificData.java:227)
at org.apache.avro.specific.SpecificDatumWriter.<init>(SpecificDatumWriter.java:35)
The code used to serialize object is based on http://grokbase.com/t/avro/user/142ke6ymcm/general-purpose-serialization-and-deserialization-for-avro-generated-specificrecords
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?
Thanks
Mime
View raw message