NiFi SplitJSON and ExecuteSQL

Viewed 6093

In a NiFi flow, I want to read a JSON structure, split it, use the payload to execute a SQL query, and finally output each result in a JSON file.

However I am having problems retrieving the value of the splitted FlowFile's attribute in the ExecuteSQL processor.

enter image description here

  1. GenerateFlowFile processor, with a JSON structure as Custom Text

enter image description here

  1. SplitJSON, with data as the attribute to be splitted

enter image description here

  1. ExecuteSQL, with the query I am trying to execute, using the SplitJSON's payload attribute ${id}

enter image description here

At this point I am getting a log error of a SQL syntax error. Apparently the ExecuteQuery processor is not parsing the expression on its SQL select query property.

Is there any intermediate processing left to be done after splitting the JSON? What am I missing?

1 Answers
Related