我想知道这个 json 文档的 Avro 模式是什么样的。
推文.json:
{
"_id": {
"$oid" : "54d148b471eb130b1e8b4567"
},
"nome": "Marco Correia",
"tweet": "This and a simple tweet",
"datahora": "Tue Feb 03 22:15:54 +0000 2015"
}
Run Code Online (Sandbox Code Playgroud)
我创建的架构给出了错误。
架构.avsc:
{
"type" : "record",
"name" : "twitter_schema",
"namespace" : "com.miguno.avro",
"fields" : [
{
"name" : "_id", "type": "array","items": "bytes"
},
{ "name" : "nome","type" : "string","doc" : "Name of the user account on Twitter.com" },
{ "name" : "tweet", "type" : "string","doc" : "The content of the …Run Code Online (Sandbox Code Playgroud) 我在创建 avro 方案时遇到问题,下面我将放置我的方案。
\n\n推特.avsc:
\n\n{\n "type" : "record",\n "name" : "twitter_schema",\n "namespace" : "com.miguno.avro",\n "fields" : [\n { "name" : "_id", "type" : "record", "doc" : "Values of the indexes/id tweets"},\n { "name" : "nome","type" : "string","doc" : "Name of the user account on Twitter.com" },\n { "name" : "tweet", "type" : "string","doc" : "The content of the user\'s Twitter message" },\n { "name" : "datahora", "type" : "string","doc" : "Unix epoch time in seconds"}\n\n ],\n "doc:" : …Run Code Online (Sandbox Code Playgroud)