Liran Yacovian
Liran Yacovian

Reputation: 11

Load CSV file to mySQL using NiFi

I am trying to load CSV file into mySQL database but failing doing this when there are fields with empty strings like ''. My Flow file looks like this --> Flow

My CSVreader configuration looks like this --> enter image description here

The table schema and data that I try to import with CSV-->

enter image description here

I created this table as CSV and try to load it into another DB with same schema but fails because of the second line with name ='' , for some reason NiFi reads this as NULL which isn't possible and not the right data.

How can I fix this?

Edit: That's how the CSV file looks like in editor--> enter image description here

"id","name","age"
1,"ggg",
2,"",

Upvotes: 1

Views: 1126

Answers (1)

Fenerbahce
Fenerbahce

Reputation: 31

You have left name column empty in the second insert statement. Is not it normal to looks null in the csv?

Upvotes: 2

Related Questions