Avro嵌套数组异常

问题描述

我正在尝试为嵌套数组生成avro模式。 阵列存储量最高的是问题,但是内部阵列业务是正确的。

{"name": "Stores","type": {
     "type": "array","items": {
         "name": "Hours","type": "record","fields": [
        {
          "name": "Week","type": "string"
        },{"name": "Business","type":"array","items": {"name":"Business_record","type":"record","fields":[
                  {"name": "Day","type":"string"},{"name": "StartTime","type": "string"},{"name": "EndTime","type": "string"}
                        ]}
                    }
                ]
               
      }
      }
     

我得到的例外是:

[ {
  "level" : "fatal","message" : "illegal Avro schema","exceptionClass" : "org.apache.avro.SchemaParseException","exceptionMessage" : "No type: {\"name\":\"Stores\",\"type\":{\"type\":\"array\",\"items\":{\"name\":\"Hours\",\"type\":\"record\",\"fields\":[{\"name\":\"Week\",\"type\":\"string\"},{\"name\":\"Business\",\"type\":\"array\",\"items\":{\"name\":\"Business_record\",\"fields\":[{\"name\":\"Day\",{\"name\":\"StartTime\",{\"name\":\"EndTime\",\"type\":\"string\"}]}}]}}}","info" : "other messages follow (if any)"
} ]

我认为外部数组字段与[]或{}有关,但我无法弄清楚。 任何帮助表示赞赏。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)