on-internet
← Community

Problems in avro schema .. String, null

Stack Overflow ·

In this avro schema {"type": "record", "name": "Member", "fields": [ {"name": "name", "type": ["string", "null"] }, {"name": "skill", "type": "string"} ]} When I try to assign multiple values to name like multiple records ... ByteArrayOutputStream bos=new ByteArrayOutputStream(); Encoder e= EncoderFactory.get().binaryEncoder(bos, null); GenericRecord rec=new GenericData.Record(schema); GenericDatumWriter<GenericRecord> datumWriter = new GenericDatumWriter<GenericRecord>(schema); for(int i=0;i<memlist.size();i++) { rec.put("name", memlist.get(i).name); rec.put("skill", memlist.get(i).skill); da

Comments

Sign in or sign up to comment and upvote.

No comments yet.