Support Questions

Find answers, ask questions, and share your expertise

Nifi - how to run a simple standalone INSERT SQL statement

avatar
Expert Contributor

Hello Experts,

 I want to run a simple Hive Insert SQL statement in Nifi periodically for example:

insert overwrite Table1 select * from Table2; 

All SQL values are fixed hardcoded and don't need to be changed dynamically in the flow. As a newbie I was thinking I could write the flow as:

 

ReplaceText->success->PutHiveQL

 

Search Value:  (?s)(^.*$)
Replacement Value:  insert overwrite Table1 select * from Table2; 
 
But I have an error in ReplaceText which probably needs an incoming flowfile which I don't have since the SQL is fixed hardcoded:
"Upstream Connections is invalid because Processor requires an upstream connection but currently has none." 
 
The other option I could try but not sure it will work is:

GenerateFlowFile -> success -> PutHiveQL

GenerateFlowFile Custom Text: insert overwrite Table1 select * from Table2;

 
 

 

  

1 ACCEPTED SOLUTION

avatar
Super Guru

The alternative your mentioned of using GenerateFlow file is the way to go here.

--
Was your question answered? Please take some time to click on "Accept as Solution" below this post.
If you find a reply useful, say thanks by clicking on the thumbs up button.

View solution in original post

1 REPLY 1

avatar
Super Guru

The alternative your mentioned of using GenerateFlow file is the way to go here.

--
Was your question answered? Please take some time to click on "Accept as Solution" below this post.
If you find a reply useful, say thanks by clicking on the thumbs up button.