- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
How to insert into db in order file contains the data using PutFile or PutDatabaseRecord in NiFI
- Labels:
-
Apache NiFi
Created 08-28-2024 08:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a simple file having say 1000 lines each of which contains say username and useraddress. I need to insert it into db. How to insert it in order. I am able to use PutFile and PutDatabaseRecord both for the insertion purpose. But they insert randomly in any order. I wanted it to be inserted in the same order it is present in the file.
How to do that.
Created 09-04-2024 02:51 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am not able to understand the context here. It would help to get to right solution if you can explain why the inserts into same table should be executed in certain order.
However, Nifi Connection configuration settings have prioritizers. Please check screenshot below..
If you are able to set attribute "priority" with desired number, "PriorityAttributePrioritizer" can be used. Please note that these prioritizers operate on node level. You may have to test these if you have multi node nifi environment.
There is a processor "EnforceOrder" which has more options to enforce execution order. You may check this processor and find out if it works.
