Created on 08-17-2016 02:13 PM - edited 08-19-2019 04:47 AM
Hi
I'am using splitjson for splitting json.
After that i am using convertJsonToSql and putsql but nifi only puts last json part of the splitted jsons. I want to insert all parts.
Do you have any idea why i can't do that. Thanks.
source json:
{ "endorsement" : 59.9, "eventId" : "c54902db-50de-4dbd-b908-4317981931fc", "categoryId" : "1000230", "createDate" : "2016-08-18T10:15:00.361Z", "buyerId" : "4748764", "channel" : "MOBILE_IOS", "city" : "Bursa" }, { "endorsement" : 13.11, "eventId" : "c54902db-50de-4dbd-b908-4317981931fc", "categoryId" : "1000491", "createDate" : "2016-08-18T10:15:00.361Z", "buyerId" : "4748764", "channel" : "MOBILE_IOS", "city" : "Bursa" } ]
after split json there are two jsons:
Created 08-18-2016 01:42 PM
i found the problem.
Reason was the hbase, i am sending same values as key so, it is impossible. After changing key values, everything working fine.
Thanks
Created 08-17-2016 05:04 PM
Can you provide an example JSON document that is not splitting correctly?
Created 08-17-2016 05:47 PM
Could you provide an example of the json you're trying to split, and what is in some of the resulting flowfiles after the SplitJson processor? I suspect that the JsonPath being used might not be splitting the json the way you want.
Created 08-17-2016 06:01 PM
Splitting is done correctly. I am watching al the processes till Last process.putsql processes passes insert sql statements according to data provenance.
But still last json part as a record is inserted all the time.
Created 08-18-2016 01:44 AM
ConvertJSONtoSQL expects the JSON object (to be converted to an INSERT/UPDATE statement) to be in the flow file content, not the attributes. Between your SplitJson and your ConvertJSONtoSQL you have a couple of processors like EvaluateJsonPath and AttributesToJSON. What is your configuration for AttributesToJSON? What does that last UpdateAttribute processor do before it goes to ConvertJSONtoSQL? If you could share a template (perhaps a scrubbed version to remove your server-specific information?) that would be helpful as well.
Created on 08-18-2016 07:34 AM - edited 08-19-2019 04:46 AM
because of the attachment limit i continue with this message:
two splitted json:
two putsql queryy:
Created 08-18-2016 01:42 PM
i found the problem.
Reason was the hbase, i am sending same values as key so, it is impossible. After changing key values, everything working fine.
Thanks