我想使用nifi从csv创建嵌套的json- CSV文件:
“ Foo”,12,“纽约”,“北大街”,“ 123213” “ Foo1”,12,“纽约”,“北大街”,“ 123213” “ Foo2”,12,“纽约”,“北大街”,“ 123213”
必需的Json:
{
"studentName":"Foo",
"Age":"12",
"address__city":"newyork",
"address":{
"address__address1":"North avenue",
"address__zipcode":"123213"
}
}
我正在通过应用avro模式使用nifi 1.4 convertRecord处理器,但无法获取嵌套的json。
Avro模式:
{
"type" : "record",
"name" : "MyClass",
"namespace" : "com.test.avro",
"fields" : [ {
"name" : "studentName",
"type" : "string"
}, {
"name" : "Age",
"type" : "string"
}, {
"name" : "address__city",
"type" : "string"
}, {
"name" : "address",
"type" : {
"type" : "record",
"name" : "address",
"fields" : [ {
"name" : "address__address1",
"type" : "string"
}, {
"name" : "address__zipcode",
"type" : "string"
} ]
}
} ]
}
答案 0 :(得分:0)
您将需要: