Skip to content

Instantly share code, notes, and snippets.

@jvwing
Created October 31, 2016 22:05
Show Gist options
  • Save jvwing/928ed1e9f7c1ae472910e83aacc5d49d to your computer and use it in GitHub Desktop.
Save jvwing/928ed1e9f7c1ae472910e83aacc5d49d to your computer and use it in GitHub Desktop.
Avro schema for a lightweight summary of a Tweet
{
"namespace": "com.batchiq.samples.tweet",
"type": "record",
"name": "tweetsummary",
"fields": [
{"name": "id", "type": "long"},
{"name": "id_str", "type": "string"},
{"name": "created_at", "type": "string"},
{"name": "timestamp_ms", "type": "string"},
{"name": "lang", "type": "string"},
{"name": "text", "type": "string"},
{"name": "user", "type": {
"type": "record",
"name": "User",
"fields": [
{"name": "id", "type": "long"},
{"name": "id_str", "type": "string"},
{"name": "name", "type": "string"},
{"name": "screen_name", "type": "string"},
{"name": "location", "type": ["null", "string"]},
{"name": "url", "type": ["null", "string"]},
{"name": "description", "type": ["null", "string"]},
{"name": "followers_count", "type": "long"},
{"name": "friends_count", "type": "long"}
]
}},
{"name": "entities", "type": {
"type": "record",
"name": "Entities",
"fields": [
{"name": "hashtags", "type": {
"type": "array", "items": {
"type": "record",
"name": "Hashtag",
"fields": [
{"name": "text", "type": "string"}
]
}
}},
{"name": "user_mentions", "type": {
"type": "array", "items": {
"type": "record",
"name": "UserMention",
"fields": [
{"name": "id", "type": "long"},
{"name": "id_str", "type": "string"},
{"name": "screen_name", "type": "string"},
{"name": "name", "type": "string"}
]
}
}}
]
}}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment