Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Support Questions

Find answers, ask questions, and share your expertise
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!

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.