Support Questions

Find answers, ask questions, and share your expertise

none of the fields in the records map to the columns CSV to putDatabaseRecord

Explorer

I am trying to read a csv file and put those records into a postgres table. To do it, I have used some tips given Loading a simple CSV file using nifi.

 

My template is :

GetFile -> UpdateAttribute -> PutDatabaseRecord

 

In UpdateAttribute I have used `schema.name` -> `postgres database`

 

In PutDatabaseRecord ->

 

CSVReader

csvreader.png

 

AvroSchemaRegistry

avroregistry.png

 

DBCPConnectionPool

dbcb.png

putdatabase.png

 

My CSV file

```

userid,username

1,'sachith'

```

 

When I put this to my source folder, it goes to PutDatabaseRecord and gives following error

 

> None of the fields in the record map to columns defined by the nifi.nifiTest table.

 

First I used MySQL just with GetFile -> PutDatabaseRecord, it was working properly without error.

 

What am I missing here? I am pretty new for Nifi.

1 ACCEPTED SOLUTION

Explorer

I have fixed this issue with the help of my supervisor. I have used only two processors.

 

GetFile and PutDatabaseRecord.

 

Two changes made for `PutDatabaseRecord` Processor

 

1) Schema name : public

 

2) Translate field names : false

 

Also didnt use AVRO reader.

 

I hope this would help someone.

View solution in original post

3 REPLIES 3

Explorer

I have fixed this issue with the help of my supervisor. I have used only two processors.

 

GetFile and PutDatabaseRecord.

 

Two changes made for `PutDatabaseRecord` Processor

 

1) Schema name : public

 

2) Translate field names : false

 

Also didnt use AVRO reader.

 

I hope this would help someone.

New Contributor

AvroReader is required in PutDatabaseRecord, I have the same issue, how you solve it?

Explorer

Sorry, I havent use AVRO, as my scenario entirely based on csv data. I think posting a new question may give attention from community.

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.