我是 AVRO 的新手。我们已经开始使用 AVRO 模式来读取数据。
现在我们有一个用例,我需要在读取时截断数据。
假设我的 avro schcema 是这样的
{
"name": "table",
"namepsace": "csd",
"type": "record",
"fields": [
{"name": "CustId", "type":"string"},
{"name": "ProductId", "type":"string"},
{"time": "time", "type":"long"}
]
}
现在数据是这样的。
{
"CustId" : "abc1234"
"ProductID" : "ABC1234567"
"time" : 123456789
}
当我读取数据时,我想截断 ProductID 字段。在上面的示例中,当我读取 ProductID 是 ABC1234567 时,我想将其截断为 5 个字符 ABC12
我可以在模式中指定任何东西来截断它吗?