Skip to content

Instantly share code, notes, and snippets.

@josephglanville
Last active August 6, 2020 03:07
Show Gist options
  • Save josephglanville/8c2c07384963b649facf99ef905db95e to your computer and use it in GitHub Desktop.
Save josephglanville/8c2c07384963b649facf99ef905db95e to your computer and use it in GitHub Desktop.
Avro example file
{
"type": "record",
"name": "SomeAvroDatum",
"namespace": "org.apache.druid.data.input",
"fields": [
{
"name": "timestamp",
"type": "long"
},
{
"name": "eventType",
"type": "string"
},
{
"name": "id",
"type": "long"
},
{
"name": "someOtherId",
"type": "long"
},
{
"name": "isValid",
"type": "boolean"
},
{
"name": "someIntArray",
"type": {
"type": "array",
"items": "int"
}
},
{
"name": "someStringArray",
"type": {
"type": "array",
"items": "string"
}
},
{
"name": "someIntValueMap",
"type": {
"type": "map",
"values": "int"
}
},
{
"name": "someStringValueMap",
"type": {
"type": "map",
"values": "string"
}
},
{
"name": "someUnion",
"type": [
"null",
"string"
]
},
{
"name": "someNull",
"type": "null"
},
{
"name": "someFixed",
"type": {
"type": "fixed",
"name": "MyFixed",
"size": 16
}
},
{
"name": "someBytes",
"type": "bytes"
},
{
"name": "someEnum",
"type": {
"type": "enum",
"name": "MyEnum",
"symbols": [
"ENUM0",
"ENUM1",
"ENUM2"
]
}
},
{
"name": "someRecord",
"type": {
"type": "record",
"name": "MySubRecord",
"fields": [
{
"name": "subInt",
"type": "int"
},
{
"name": "subLong",
"type": "long"
}
]
}
},
{
"name": "someLong",
"type": "long"
},
{
"name": "someInt",
"type": "int"
},
{
"name": "someFloat",
"type": "float"
},
{
"name": "someRecordArray",
"type": {
"type": "array",
"items": {
"type": "record",
"name": "MyNestedRecord",
"fields": [
{
"name": "nestedString",
"type": "string"
}
]
}
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment