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]
Created on 03-15-2017 02:50 PM - edited 09-16-2022 04:15 AM
I have a very basic flow that I have put together to test a concept for a presentation. (Btw, relatively new to NiFi). The flow is setup like this: QueryDatabaseTable->SplitAvro->ConvertAvroToJSON->Putfile->LogAttributes
The query is very simple for the Query processor: "select * from test2" which has 8 rows of data. When I fire off the flow, basically it keeps generating files over and over containing the same 8 rows of data in each file.
I know this is probably something very simple to fix, but I just can't seem to find the setting where it will just run once...
I looked around on the boards but did not find anything similar (or entirely possible I maybe missed it).
Does anyone have a suggestion?
Thanks!
♣km
Created 03-15-2017 03:55 PM
Please verify what have you configured for "Maximum-Value Column" in the QueryDatabaseTable processor. Plus how is your table structured. Nifi needs an increment key to determine the maximum id previously fetched.
Following article will help"
Created 03-15-2017 03:55 PM
Please verify what have you configured for "Maximum-Value Column" in the QueryDatabaseTable processor. Plus how is your table structured. Nifi needs an increment key to determine the maximum id previously fetched.
Following article will help"
Created 03-15-2017 04:34 PM
Thank you! That was it. I had no values in my Maximum-Value Column.
Created 03-15-2017 06:15 PM
Your QueryTable processor queries continuously your table and generates a FlowFile with each query result. Right-click on QueryTable processor, then Configure and Settings tab and you will see that by default Run Schedule is set to 0 seconds. That means query after query. You can change the interval to more seconds as such a new query will be fired later. Keep in mind that your query can be also smart to pick-up only new records. Is query doing that?
+++
If this helped, please vote/accept best answer.
Created 03-17-2017 01:05 PM
@Constantin Stanca Thank for the follow up. This was very helpful in addition to Umair's answer. I changed the query to pick up the max rowid for the new records. Again, very helpful tip!