Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

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

avatar
Contributor

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

avatar
Contributor

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

avatar
Contributor

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.

avatar
New Contributor

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

avatar
Contributor

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