jolt

How do I transform an array using Jolt?

懵懂的女人 提交于 2021-02-15 21:01:26
问题 I am getting a null value for my transformed object when trying to convert something like this: { "employees": [ { "f_name" : "tom", "l_name" : "smith" }, { "f_name" : "don", "l_name" : "jones" } ] } to this: { "employees": [ { "firstName" : "tom", "lastName" : "smith" }, { "firstName" : "don", "lastName" : "jones" } ] } This is the spec I am using: [ { "operation" : "shift", "spec" : { "employees" : { "f_name" : "firstName" "l_name" : "lastName" } } ] This is the code I am using: List<Object

How do I transform an array using Jolt?

寵の児 提交于 2021-02-15 20:55:34
问题 I am getting a null value for my transformed object when trying to convert something like this: { "employees": [ { "f_name" : "tom", "l_name" : "smith" }, { "f_name" : "don", "l_name" : "jones" } ] } to this: { "employees": [ { "firstName" : "tom", "lastName" : "smith" }, { "firstName" : "don", "lastName" : "jones" } ] } This is the spec I am using: [ { "operation" : "shift", "spec" : { "employees" : { "f_name" : "firstName" "l_name" : "lastName" } } ] This is the code I am using: List<Object

How do I transform an array using Jolt?

人盡茶涼 提交于 2021-02-15 20:55:20
问题 I am getting a null value for my transformed object when trying to convert something like this: { "employees": [ { "f_name" : "tom", "l_name" : "smith" }, { "f_name" : "don", "l_name" : "jones" } ] } to this: { "employees": [ { "firstName" : "tom", "lastName" : "smith" }, { "firstName" : "don", "lastName" : "jones" } ] } This is the spec I am using: [ { "operation" : "shift", "spec" : { "employees" : { "f_name" : "firstName" "l_name" : "lastName" } } ] This is the code I am using: List<Object

Jolt: split/ concat array values in Nifi

假如想象 提交于 2021-01-29 13:47:41
问题 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

JOLT concat values from nested array (Apache NiFi)

北战南征 提交于 2021-01-28 14:20:58
问题 I have a JSON: { "reports": [ { "columnHeader": { "metricHeader": { "metricHeaderEntries": [ { "name": "ga:sessions", "type": "INTEGER" }, { "name": "ga:bounces", "type": "INTEGER" }, { "name": "ga:sessionDuration", "type": "TIME" }, { "name": "ga:pageviews", "type": "INTEGER" } ] } }, "data": { "rows": [ { "metrics": [ { "values": [ "25", "18", "1269.0", "27" ] } ] } ], "totals": [ { "values": [ "25", "18", "1269.0", "27" ] } ], "rowCount": 1, "minimums": [ { "values": [ "25", "18", "1269.0"

JOLT change string to float

这一生的挚爱 提交于 2021-01-28 12:20:26
问题 Input JSON { "sId": "1000000000000000", "lat": "12.934638", "lon": "77.693950", "status": "up", "last_change": 1503452208 } My design spec: [ { "operation":"shift", "spec":{ "Id":"Id", "status":"status", "last_change":"last_change", "lat":{ "@(2,lat)":{ "@(2,lat)":"geocoordinate.coordinates[0]" } }, "lon":{ "@(2,lon)":{ "@(2,lon)":"geocoordinate.coordinates[1].", "#Point":"geocoordinate.type" } } } } ] as lat long is coming as string but in output i want to have it as float. i tried

JOLT transformation for nested JSON?

感情迁移 提交于 2021-01-28 12:20:21
问题 I have a JSON that looks like this : { "Level1": { "Level2": { "val1": "Test", "val2": "Val" } } } When I apply the followng Jolt shift transformation to this : [{ "operation": "shift", "spec": { "Level1": { "Level2": { "val1": "val001", "val2": "val002" } } } }] I get the folliwng result : { "val001": "Test", "val002": "Val" } Why cant I see the Level1, Level2 in the output? Please an someone help, I want to see that in the output too similar to whats the input. 回答1: The values in the shift