snowplow / iglu-central

Contains all JSON Schemas, Avros and Thrifts for Iglu Central
http://iglucentral.com
Apache License 2.0
118 stars 114 forks source link

Create self-describing Avro for enriched events #212

Open fblundun opened 9 years ago

fblundun commented 9 years ago

The first version of the Avro will probably have:

fblundun commented 9 years ago

First draft:

{
    "name": "EnrichedEvent",
    "type": "record",
    "fields": [
        {
            "name": "version",
            "type": "string"
        },
        {
            "name": "columns",
            "type": {
                "type": "array",
                "items": {
                    "name": "column",
                    "type": "string"
                }
            }
        }
    ]
}

Note this isn't yet self-describing.

alexanderdean commented 9 years ago

I like! On 11 Sep 2015 11:18 am, "Fred Blundun" notifications@github.com wrote:

First draft:

{ "name": "EnrichedEvent", "type": "record", "fields": [ { "name": "version", "type": "string" }, { "name": "columns", "type": { "type": "array", "items": { "name": "column", "type": "string" } } } ] }

Note this isn't yet self-describing.

— Reply to this email directly or view it on GitHub https://github.com/snowplow/iglu-central/issues/212#issuecomment-139508768 .

fblundun commented 9 years ago

Actually we should allow the elements of the array to be null, since most of our fields aren't populated at all:

{
    "namespace": "com.snowplowanalytics.avro",
    "name": "EnrichedEvent",
    "type": "record",
    "fields": [
        {
            "name": "version",
            "type": "string"
        },
        {
            "name": "columns",
            "type": {
                "type": "array",
                "items": ["null","string"]
            }
        }
    ]
}
alexanderdean commented 9 years ago

Agree