Search code examples
databasepostgresqlcsvapache-nifi

None of the fields in the record map to the columns apache-nifi


I am trying to insert records from Oracle to Postgresql. To do it, I use QueryDatabaseTableRecord -> PutDatabaseRecord

QueryDatabaseTableRecord -> Fetch from Oracle Writer -> CSV

PutDatabaseRecord -> to insert record to Postgresql.

Reader -> CSV

A few weeks ago, I faced with the same issue with Postgresql. cloudera question.

This time I made schema to public and Translate field name : false

I have changed postgresql table columns into block letters as I have used in oracle.


Solution

  • I found the solution for this. Its not directly related Apache-NiFi, kind of Postgresql related thing.

    Data taken from Oracle comes with Upper-case headers. Headers MUST be converted to Lower-case. Creating postgresql columns with Upper-case wont solve this issue.

    To do this, I have used Replace Text processor.

    Search Value : MY_COLUMN1,MY_COLUMN2
    Replacement Value : my_column1,my_column2
    

    I hope this will help someone who is trying to get data from Oracle and put them back into Postgresql.