【发布时间】:2017-02-28 21:43:48
【问题描述】:
我目前正在创建 Avro 模式来存储 twitter 数据流。 我的 JSON 数据源:
{
'id': '123456789',
'text': 'bla bla bla...',
'entities': {
'hashtags': [{'text':'hashtag1'},{'text':'hashtag2'}]
}
}
在 Cassandra 中,我可以定义集合(集合或列表)来存储主题标签数据。 但我不知道如何在 Apache Avro 中定义这种结构。
这是我最好的尝试:
{"namespace": "ln.twitter",
"type": "record",
"name": "main",
"fields": [
{"name": "id","type": "string"},
{"name": "text","type": "string"},
{"name": "hashtags","type": "string"} // is there any better format for this ?
]
}
需要你的建议。
谢谢, 汤太。
【问题讨论】:
标签: list collections schema avro