Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

problem with JsonToSQL in nifi

problem with JsonToSQL in nifi

New Contributor

Hi all! 

I have a problem with injecting data to Postgers from RMQ 

I'm getting this kind of JSON:

{
"id" : "6aa0734f-6d6a-4b95-8a2b-2dde346f9df7",
"ts" : 1583673235360000,
"A4" : {
"value" : 131921728
},
"A5" : {
"value" : -3094532.25
},
"A6" : {
"value" : 5.379446506500244
},
"A7" : {
"value" : 131921728
},
"A8" : {
"value" : -3094532.25
},
"CurrentAnglePhaseA" : {
"value" : -1.5962449312210083
},
"CurrentAnglePhaseB" : {
"value" : 2.588104248046875
},
"CurrentAnglePhaseC" : {
"value" : 0.500185489654541
},
"CurrentMagnitudePhaseA" : {
"value" : 4598.7783203125
},
"CurrentMagnitudePhaseB" : {
"value" : 4738.97705078125
},
"CurrentMagnitudePhaseC" : {
"value" : 4627.10791015625
},
"D1" : {
"value" : 1
},
"D2" : {
"value" : 0
},
"D3" : {
"value" : 0
},
"D4" : {
"value" : 0
},
"D5" : {
"value" : 1
},
"D6" : {
"value" : 1
},
"D7" : {
"value" : 1
},
"D8" : {
"value" : 0
},
"Dfrequency" : {
"value" : 0
},
"Frequency" : {
"value" : 49.854896545410156
},
"NeutralConductorCurrent" : {
"value" : 5.379446506500244
},
"PowerActiveTriPhase" : {
"value" : 131921728
},
"PowerReactiveTriPhase" : {
"value" : -3094532.25
},
"Stat" : {
"value" : 0
},
"VoltageAnglePhaseA" : {
"value" : -2.381643056869507
},
"VoltageAnglePhaseB" : {
"value" : 1.8027061223983765
},
"VoltageAnglePhaseC" : {
"value" : -0.2852126657962799
},
"VoltageMagnitudePhaseA" : {
"value" : 9445.6533203125
},
"VoltageMagnitudePhaseB" : {
"value" : 9452.943359375
},
"VoltageMagnitudePhaseC" : {
"value" : 9452.1650390625
}

and trying to create SQL insert with JsonToSQL in nifi flow, but getting withs kind of error: 

 

ConvertJSONToSQL[id=ab09a4e9-0170-1000-0000-0000114880ef] Failed to parse StandardFlowFileRecord[uuid=4cfc675c-9667-4a03-96a7-f523e3791dff,claim=StandardContentClaim [resourceClaim=StandardResourceClaim[id=1583672912586-10, container=default, section=10], offset=811651, length=56],offset=0,name=bde25c42-724d-4064-bd48-2203cfce7668,size=56] as JSON due to org.apache.nifi.processor.exception.ProcessException: IOException thrown from ConvertJSONToSQL[id=ab09a4e9-0170-1000-0000-0000114880ef]: org.codehaus.jackson.JsonParseException: Unexpected character ('I' (code 73)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')

 

 what's wrong with the the flow? 

 

Thanks 

Don't have an account?
Coming from Hortonworks? Activate your account here