Search code examples
apache-nifi

Multiple dependent create statements in one processor


I have 6 tables which I want to create one after the other - each successive table is dependent on the previous one.

I tried to put all 6 SQL scripts into one PutSQL-processor in Apache Nifi, but the processor failed when trying to create table_2 with the error table_1 does not exist.

I'm guessing that changes are not committed to Redshift until the entire script is finished. I tried to get around it by activating Database Session AutoCommit, but I still get the same result.

Do I have to create 6 individual PutSQL-processors, or is there a way to put multiple SQL statements into one PutSQL processor and after each, the changes get committed to the databse?


Solution

  • The quick answer is: I have to create 6 individual PutSQL-processors because of the constraints between Nifi and AWS-Redshift.