AVRO schema for JSON with mixed record types -



AVRO schema for JSON with mixed record types -

i have next problem, kindly inquire advice. have json file events of several types come mixed in same file. each event record linear construction (no nesting). events have identifier , event type, , depending on event type, construction of fields in event record different. need create avro schema file (.avsc), in order able transform json file binary avro format. given fragment of json below, can please suggest me how build corresponding avro schema, please?

{"eventid":"ev1","eventtype":"a","timestamp": 1366150681, "fielda1": 10, "fielda2":"texta" } {"eventid":"ev2","eventtype":"a","timestamp": 1366150699, "fielda1": 11, "fielda2":"atext" } {"eventid":"ev3","eventtype":"b","timestamp": 1366150750, "fieldb1": "textb" } {"eventid":"ev4","eventtype":"a","timestamp": 1366150821, "fielda1": 9, "fielda2":"texta" } {"eventid":"ev5","eventtype":"c","timestamp": 1366150920, "fieldc1": 100, "fieldc2":200, "fieldc3":400 } {"eventid":"ev6","eventtype":"c","timestamp": 1366150950, "fieldc1": 90, "fieldc2":150, "fieldc3":200 } {"eventid":"ev7","eventtype":"b","timestamp": 1366150999, "fieldb1": "btext"}

and on ...

thank much in advance! wait reply possible, please.

json avro

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -