Hi there,

I'm trying to define a record with a sub-record but I keep getting an error.

I modified the example cpx.json as follows:



[

{

    "type": "record",

    "name": "cpy",

    "fields" : [

        {"name": "re", "type": "double"},

        {"name": "im", "type" : "double"}

    ]

}

,

{

    "type": "record",

    "name": "cpx",

    "fields" : [

        {"name": "re", "type": "double"},

        {"name": "im", "type" : "double"},

        {"name": "opt", "type" : union ["null","cpy"]}

    ]

}

]



And get the following error:



terminate called after throwing an instance of 'avro::Exception'

  what():  Invalid operation. Expected: Double got Union union Aborted



Is the schema supposed to be written differently when multiple records are 
defined?



Thanks,



Francois.

Reply via email to