我将JSON文件和JSON模式解析为AVRO模式.我有点困惑,我是否必须使用AVRO文档中定义的数据类型编写手动AVRO模式.
或者是否有任何自动化方法/功能/程序可以根据需要完全相同?
我是AVRO的新手,请问这是一个简单的问题。我有一个用例,其中我使用AVRO模式进行记录调用。
假设我有Avro模式
{
"name": "abc",
"namepsace": "xyz",
"type": "record",
"fields": [
{"name": "CustId", "type":"string"},
{"name": "SessionId", "type":"string"},
]
}
Run Code Online (Sandbox Code Playgroud)
现在,如果输入像
{
"CustId" : "abc1234"
"sessionID" : "000-0000-00000"
}
Run Code Online (Sandbox Code Playgroud)
我想对这些字段使用一些正则表达式验证,并且仅当输入格式如上所示时才接受此输入。有什么方法可以在avro模式中指定包含正则表达式的表达式吗?
还有其他支持这样的数据序列化格式吗?
Hi folks I need to create AVRO schema for the following example ;
{ "Car" : { "Make" : "Ford" , "Year": 1990 , "Engine" : "V8" , "VIN" : "123123123" , "Plate" : "XXTT9O",
"Accident" : { "Date" :"2020/02/02" , "Location" : "NJ" , "Driver" : "Joe" } ,
"Owner" : { "Name" : "Joe" , "LastName" : "Doe" } }
Run Code Online (Sandbox Code Playgroud)
Accident and Owner is optional objects and created schema also needs to validate following subset message;
{ "Car" …Run Code Online (Sandbox Code Playgroud)