【发布时间】:2020-03-23 12:13:19
【问题描述】:
JSON 负载:
{
"BILLING_EVENT_RULE_MET_DT": "lsks",
"PlanType":"hhh"
}
AVRO 架构:
{
"name": "Subscription",
"type":"record",
"doc": "Subscription details",
"fields":
[
{ "name": "BILLING_EVENT_RULE_MET_DT", "type":[ "null","string"],"default": null },
{"name": "PlanType",
"type":
{
"name":"PlanType",
"type": "fixed",
"size": 4
}
}
]
}
ERROR:
The value [hhh] for field [PlanType] should be [FixedType <size: 4, name: PlanType, namespace: None, aliases: None>].
在验证它给我以下错误时,我应该在 PlanType 字段的 json 有效负载中写什么? 实际上这就是我正在探索的所有内容,因为我想为类似于 XML 模式的 AVRO 模式中的字段定义 maxlength 和 minlength。
【问题讨论】:
标签: json schema avro avro-tools