first I think your schema declares each field as mandatory. You should
use the union form to declare an optional field.

....

"type": ["null", "long"]

second - the avro file is not intended as a database - just serialize
the whole file again, updating does not really make sense.





2014-11-12 16:53 GMT+01:00 Murali K. Kandula <[email protected]
>:

>  Hello All,
>
>
>  "{\"type\":\"record\",\  \"name\":\"Person\",\  \"fields\":[\     {\"name\": 
> \"ID\", \"type\": \"long\"},\     {\"name\": \"First\", \"type\": 
> \"string\"},\     {\"name\": \"Last\", \"type\": \"string\"},\     {\"name\": 
> \"Phone\", \"type\": \"string\"},\     {\"name\": \"Age\", \"type\": 
> \"int\"}]}”;
>
>
> For the schema mentioned above is it possible to add fields one at a time for 
> a particular record. Ex: Let say a record with values ( ID: 1, first: abcd, 
> last:xyz, phone: 111-222-3344, age:30) can we write this record to the file 
> with only the field ID(with value 1) and then later update the record with 
> ID( of value 1) with first,last,phone and age.
>
>
> Please let me know if it’s possible.
>
>
> Thanks
>
> Murali
>
>

Reply via email to