Created 01-23-2024 11:26 PM
Hi All,
we try to fetch the results from database according to the content of cvs file.after converting the csv to json format by SpileRecord then we try to get the content of Json record by EvaluateJsonPath then we try to get value of attribute by UpdateAttribute but the FF_Content attribute into inEvaluateJsonPath not recognized .
listFile->FetchFiles->SpileRecord->EvaluateJsonPath ->UpdateAttribute ->ExecuteSQL
Created 01-26-2024 01:31 AM
@ALWOSABY, in EvaluateJsonPath, you set EvaluateJsonPath to write the information in the content of the flow file, and not in the attributes. In your next processor, you are using the FF_CONTENT as an attribute and it does not exist ... hence your flow not working as expected.
Do you require the content of the JSON or do you need to generate some new attributes based on the content of the flow file?
If you require the content as well, I would suggest to add a new EvaluateJsonPath after your first one and modify to write the information as attributes and generate your desired attributes.
If you only require some new attributes, modify the logic in your first EvaluateJsonPath to write the data as attributes and generate your desired attributes, using the Record Path for JSON.
Have a look at your first EvaluateJsonPath and make sure that the data is extracted correctly, because it first glance, I am not quite certain it works properly.
Created 01-24-2024 12:31 AM
@ALWOSABY, Welcome to our community! To help you get the best possible answer, I have tagged our NiFi experts @SAMSAL @cotopaul @MattWho who may be able to assist you further.
Please feel free to provide any additional information or details about your query, and we hope that you will find a satisfactory solution to your question.
Regards,
Vidya Sargur,Created on 01-26-2024 01:33 AM - edited 01-26-2024 01:35 AM
Hi @ALWOSABY ,
What is the value of the FF_Content? is it the entire JSON record ? if so - as it appears from the specified path - Why not use the EvaluateJsonPath to get whatever values that are needed and store as attributes by setting the Destination property to flowfile-attribute.
See the following post to learn more: https://community.cloudera.com/t5/Support-Questions/How-to-handle-json-using-EvaluateJsonPath-proces...
If that helps please accept solution.
Thanks
Created 01-26-2024 01:31 AM
@ALWOSABY, in EvaluateJsonPath, you set EvaluateJsonPath to write the information in the content of the flow file, and not in the attributes. In your next processor, you are using the FF_CONTENT as an attribute and it does not exist ... hence your flow not working as expected.
Do you require the content of the JSON or do you need to generate some new attributes based on the content of the flow file?
If you require the content as well, I would suggest to add a new EvaluateJsonPath after your first one and modify to write the information as attributes and generate your desired attributes.
If you only require some new attributes, modify the logic in your first EvaluateJsonPath to write the data as attributes and generate your desired attributes, using the Record Path for JSON.
Have a look at your first EvaluateJsonPath and make sure that the data is extracted correctly, because it first glance, I am not quite certain it works properly.