Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

Creating a table in postgresql from a csv using nifi

avatar
New Member

I am pretty new to nifi so bear with me.

I am trying to use nifi to take a csv with data in it and create a table using nifi and upload it to a database. I have a grasp on the putsql processor and how to insert the data into an already existing table. Any help would be appreciated

1 ACCEPTED SOLUTION

avatar
Guru

If you know how to split it up, you can split the file into others and route each file to its own PutSQL processor.

https://community.hortonworks.com/questions/48492/split-data-into-multiple-files-using-nifi-based-on...

View solution in original post

4 REPLIES 4

avatar
Guru

Hi @Austin Duncan

I believe that the PutSQL processor can also do DDL statements such as your CREATE TABLE statement (it just issues the statements). You can also use the ExecuteScript processor and do it via script you write.

avatar
New Member

I think what im struggling with is if there is a way to have this make several different tables. Like whenever a csv is placed into a folder have it uploaded to a database.

avatar
Guru

If you know how to split it up, you can split the file into others and route each file to its own PutSQL processor.

https://community.hortonworks.com/questions/48492/split-data-into-multiple-files-using-nifi-based-on...

avatar

@Austin Duncan Hope , you found a solution and I am struggling with the same problem and I am new to HDP nifi and Postgres sql . Can you please share the same . Thanks Vijay