avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Blue <rb...@netflix.com.INVALID>
Subject Re: Array of Unions
Date Tue, 08 Aug 2017 18:42:55 GMT
John,

I think your definition should be this:

{
  "type": "array",
  "items": [ "int", "boolean", "string" ]
}

The difference is that when using the {"type": <type string>} syntax, you
can only use one type. Unions are made using lists of types. The above uses
a string (e.g., "int") as a stand-in for a full type, like {"type": "int"}.

rb
‚Äč

On Tue, Aug 8, 2017 at 11:17 AM, Gill, John <John.Gill@teradata.com> wrote:

> Is it valid for the items in an array to be Union schema?
>
> {
>   "type": "array",
>   "items": { "type": [ "int", "boolean", "string" ] }
> }
>
> According to the spec it is ambiguous:
>
>   *   items: the schema of the array's items.
>
> I have tried this schema in both python and c and it generates exceptions
> for invalid Schema. I was just curious if this was valid or not.
>
> Thanks
> - John
>



-- 
Ryan Blue
Software Engineer
Netflix

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message