本文介绍了Jolt:Nifi 中的拆分/连接数组值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在努力在 Nifi 中使用 JOLT 进行转换
我的输入
[{值0":0,值1":1,值2":2},{值0":3,值1":4,值2":5}]期望的输出:
[{"val":0 },{"val" :1 },{"val" :2 },{"val" :3 },{"val":4 },{"val":5 },]我几乎设法让它发挥作用.这是我的(错误的)Jolt 规范:
[{"操作": "移位",规格":{*":{"value*": "[&1].val"}}}]这是我的结果:
[ {"val" : [ 0, 1, 2 ]}, {"val" : [ 3, 4, 5 ]]]
谢谢!
解决方案
试试这个,
[{"操作": "移位",规格":{*":{"值*": "[].val"}}}]I'm struggling with transformation using JOLT in Nifi
My input
[
{
"value0": 0,
"value1": 1,
"value2": 2
},
{
"value0": 3,
"value1": 4,
"value2": 5
}
]
Desired Output:
[
{"val" :0 },
{"val" :1 },
{"val" :2 },
{"val" :3 },
{"val" :4 },
{"val" :5 },
]
I almost managed to get it to work. Here is my (wrong) Jolt Spec:
[
{
"operation": "shift",
"spec": {
"*": {
"value*": "[&1].val"
}
}
}
]
Here is my result:
[ {
"val" : [ 0, 1, 2 ]
}, {
"val" : [ 3, 4, 5 ]
} ]
Thanks!
解决方案
Try this,
[
{
"operation": "shift",
"spec": {
"*": {
"value*": "[].val"
}
}
}]
这篇关于Jolt:Nifi 中的拆分/连接数组值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!