【发布时间】:2016-01-29 17:29:13
【问题描述】:
我有两个架构文件
首先是 position.avsc
{
"type":"enum", "name": "Position", "namespace": "avro.examples.baseball",
"symbols": ["P", "C", "B1", "B2", "B3", "SS", "LF", "CF", "RF", "DH"]
}
其次是 player.avsc
{
"type":"record", "name":"Player", "namespace": "avro.examples.baseball",
"fields": [
{"name": "number", "type": "int"},
{"name": "first_name", "type": "string"},
{"name": "last_name", "type": "string"},
{"name": "position", "type": {"type": "array", "items": "avro.examples.baseball.Position"} }
]
}
我可以在avdl中导入这些架构
@namespace("avro.examples.baseball")
protocol Baseball {
import schema "position.avsc";
import schema "player.avsc";
}
但我想在 json 中定义上述协议并将这些模式导入协议文件中。 这将有助于模式的可重用性
【问题讨论】: