【发布时间】:2021-03-01 16:42:12
【问题描述】:
实际上我的问题类似于下面链接中显示的答案(显示使用 avsc javascript 库进行序列化/反序列化),但我需要一个解决方案来序列化到 avro 并使用 apache avro for java 反序列化它。 .
https://avro.apache.org/docs/current/gettingstartedjava.html
数据
[
{"id":1,"text":"some text","user_id":1},
{"id":1,"text":"some text","user_id":2},
...
]
架构
{
"name": "Name",
"type": "array",
"namespace": "com.hi.avro.model",
"items": {
"name": "NameDetails",
"type": "record",
"fields": [
{
"name": "id",
"type": "int"
},
{
"name": "text",
"type": "string"
},
{
"name": "user_id",
"type": "int"
}
]
}
}
感谢任何帮助...
【问题讨论】:
-
你有没有尝试过?您链接到正是出于这个原因而存在的入门指南。