Suppose I have following json:
[
{"id":1,"text":"some text","user_id":1},
{"id":1,"text":"some text","user_id":2},
...
]
What would be an appropriate avro schema for this array of objects?
Suppose I have following json:
[
{"id":1,"text":"some text","user_id":1},
{"id":1,"text":"some text","user_id":2},
...
]
What would be an appropriate avro schema for this array of objects?
Concerning your question, correct schema is
{
"name": "Name",
"type": "array",
"namespace": "com.hi.avro.model",
"items": {
"name": "NameDetails",
"type": "record",
"fields": [
{
"name": "id",
"type": "int"
},
{
"name": "text",
"type": "string"
},
{
"name": "user_id",
"type": "int"
}
]
}
}