Josh,

Sorry you haven't received a response on this, I sent one a few days ago
but I guess it didn't go through?

Does the error say "Cannot map JSON field 'ID' to any column in the
database"? If so, is it the source JSON's ID field not being found, or the
target's table ID field? If the former, you can set the "Unmatched Field
Behavior" property to "Ignore Unmatched Fields" in the processor config. If
the latter, you can set the "Unmatched Column Behavior" property to "Ignore
Unmatched Columns".

If this doesn't fix the issue, could you provide some more details around
the use case? For example the JSON content (scrubbed if need be of course),
the target table layout, and/or a stack trace or other logging/bulletin
text about the error?

Regarding PutFile to view output, an alternative is to use a LogAttribute
processor with the "Log Payload" property set to true. Then
logs/nifi-app.log will contain the attributes and content of each flow file
that it is passed. When I start NiFi I usually go right to tailing that log:

bin/nifi.sh start && tail -f logs/nifi-app.log

Regards,
Matt

On Tue, Mar 15, 2016 at 12:32 PM, Joshua D Rinker <
joshua.d.rin...@raytheon.com> wrote:

> To whom it may concern,
>
> I am trying to create a process that will export data from a MySQL
> database using a select query. This data will in turn be used to either
> update or insert records of another MySQL database. At the moment my
> process in NiFi includes the flowing
>
> Process flow:
>
> ExecuteSQL - running the select query
> ConvertAvroToJSON - to clean up the output file which according to the
> document can be used to create a SQL update or insert query
> PutFile - used for testing to view output as I'm new to NiFi
>
> The other process is:
>
> GetFile - obtains the output of the first process
> ConvertJSONToSQL - using this to take the JSON and make the SQL Insert
> query
> PutSQL - Should take the query and run it entering the data into the DB
>
> The problem I'm having is once the JSON file hits the ConvertJSONToSQL an
> error is return about the other table's ID field not being found. This ID
> filed is auto incrementing and doesn't (or shouldn't in my mind) need to be
> provided.
> Could you provide any assistance and/or design advice to get this process
> up and running correctly would be great.
>
> Thanks,
> Josh

Reply via email to