问题
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!
回答1:
Try this,
[
{
"operation": "shift",
"spec": {
"*": {
"value*": "[].val"
}
}
}]
来源:https://stackoverflow.com/questions/61387418/jolt-split-concat-array-values-in-nifi