Support Questions

Find answers, ask questions, and share your expertise

Creating a table in postgresql from a csv using nifi

avatar
New Contributor

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 Contributor

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
New Contributor

@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