I have the following json file in which an image is encoded in the photo field:
I use standard processors to work with a JSON file and try to write this file to PostgreSQL using an ExecuteSQL processor (photo in bytea format). When writing directly, it gives an error that the char format was expected. How to write the encoded image to the database correctly using apache nifi?
When using ExecuteSQL processor to do CRUD actions on database tables, we should prepare the SQL statement by ourselves.
There could be plenties of ways to do such thing. One way as you mentioned is to use the raw json data to insert/update a DB table, you might try to use PutDatabaseRecord processor, in such way, the json's structure must be flat as the avro-schema you fetched from the corresponding DB table.