我最近开始使用avdl和avro文件。我对于如何为特定字段填充两种类型感到困惑
我有这样的avdl文件
@namespace("com.bettercoding.avro")
protocol ExampleProtocol {
record CompanyRecord {
int day;//date_start
int countryCode;
}
}
将其转换为.avsc文件时,得到如下结果
{
"type" : "record",
"name" : "CompanyRecord",
"namespace" : "com.bettercoding.avro",
"fields" : [ {
"name" : "day",
"type" : "int"
}, {
"name" : "countryCode",
"type" : "int"
} ]
}
我想实现类似的目标
{
"type" : "record",
"name" : "CompanyRecord",
"namespace" : "com.bettercoding.avro",
"fields" : [ {
"name" : "day",
"type" : "int"
}, {
"name" : "countryCode",
"type" : {type:"int","logicalType":"date"}
} ]
}
我阅读了有关逻辑类型的信息,但是我无法在任何可以填充类似内容的地方进行操作。请帮助