You should be able to specify a reader schema with the namespace and the writer 
schema without it. See 
https://avro.apache.org/docs/1.7.7/api/java/org/apache/avro/specific/SpecificData.html#createDatumReader(org.apache.avro.Schema,
 org.apache.avro.Schema)

Sam 


     On Thursday, August 6, 2015 3:31 PM, Mehrez Alachheb <meh...@adomik.com> 
wrote:
   

 Hi,
I am working in project, in which i have to deserialize an avro files provided 
by an other external company.The problem is that the schema  (example below) of 
the serialized avro files doesn't contain a namespace, however i need to add 
the namespace to the avro Schema.I can't serialize the avro files with another 
schema because we get them from another  company.I created a new schema( 
example below) with name space and i generated the associated java classes.
How i can deserialize the avro files with my new schema ? 
Thanks,Mehrez.
company schema :{"type":"record", "name":"AvroData", "fields": [.....] } 
the schema that i want: {"type":"record", "name":"AvroData", 
"namespace":"company.avro", "fields": [.....] } 




  

Reply via email to