小编Edu*_*afe的帖子

如何创建 Avro 架构?

我想知道这个 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)

apache json avro

5
推荐指数
1
解决办法
1087
查看次数

创建方案 .avsc Avro 时出现问题

我在创建 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)

json avro

4
推荐指数
1
解决办法
7017
查看次数

标签 统计

avro ×2

json ×2

apache ×1