- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Need parsing and import data from ftp to sql database with nifi.
- Labels:
-
Apache NiFi
Created 06-07-2018 09:55 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi. It's my first days with nifi, so I need a lot of help!
Firstly, I've got ftp from which I need to get data. After it need to parsing and processing data. And download them on sql database.
P.S. As I understand, need to use ListFTP and FetchFTP to take data from ftp and transform them into FlowFile. But what after it? Which processors should I use?
P.S.S. Hope clearly explained.
Created 06-07-2018 10:08 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You need to use PutDataBaseRecord processor to push data to Sql database from NiFi.
Configure/enable Record Reader controller service(avro schema that matches incoming data) that can read the incoming data and and database connection then give all the details about your target table in sql server.
Refer to this link to get more details regarding configs/usage of PutDatabaseRecord processor and to this link how to Configure Record Reader controller service.
Created 06-07-2018 10:08 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You need to use PutDataBaseRecord processor to push data to Sql database from NiFi.
Configure/enable Record Reader controller service(avro schema that matches incoming data) that can read the incoming data and and database connection then give all the details about your target table in sql server.
Refer to this link to get more details regarding configs/usage of PutDatabaseRecord processor and to this link how to Configure Record Reader controller service.
Created 06-07-2018 10:27 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thx a lot!
But I still got a few questions. If you can help - it will be perfect!
At the output FetchFTP, we get a file of the CSV format?
Created 06-07-2018 10:46 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It depends on how the file is been stored on FTP server side if the file is in CSV format then FetchFTP processor pulls the file in CSV format. Fetching of files won't change the format of the file in NiFi.
If the file is in CSV format on source server side then in PutDatabaseRecord processor you need to configure/enable CSV Reader processor so that processor reads the incoming data and executes sql statements based on the SqlType property value.
Created 06-07-2018 11:02 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
And thanks again!
I hope this will be enough for the first time.
