- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Extracting .rar file in NIFI
- Labels:
-
Apache NiFi
Created 05-25-2020 01:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am getting .zip files as well as .rar files from my source location. While i am able to unzip the .zip files using unpack content processor , i am not able to extract the .rar files. I even tried compress component processor but seems that too doesn't support .rar files. How should i extract the .rar files ? install winrar in root folder and then call it using execute stream processor ?
Created 05-25-2020 09:10 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
UnpackContent processor do not support .rar file:
Hence, yes you can use an ExecuteStreamCommand processor to invoke WinRAR command-line tool.
Created 07-28-2023 08:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I realize this topic is a bit old, but I have this same problem to solve. I am struggling with setting the unrar in the ExecuteStreamCommand process, then having the decompressed files returned in the output on the stream for additional processing. I am getting broken pipe errors and unrar cmd ended in nonzero errors. How exactly do I set this up so that it works just like Nifi's native UnpackContent process? Thank you.
Created 07-28-2023 12:23 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Phil_I_AM
Always best tot start a new question rather than commenting on an old post. Will get you better traction that way from the community.
The reason NiFi does not have native processor that can handle rar files is because there does not appear to be java native libraries available to do this. https://issues.apache.org/jira/browse/NIFI-8391
You may consider filtering and writing your rar files to a flow specific directory on disk and then use the ExecuteStreamCommand processor to unpack that rar in that directory. You could have a new flow that uses the listFile (configured to ignore files with rar extension) and FetchFile processor to monitor that directory for new files and consume them for further processing.
If you found that the provided solution(s) assisted you with your query, please take a moment to login and click Accept as Solution below each response that helped.
Thank you,
Matt
![](/skins/images/C3EF05C688F0C29C1D3298241F61C2B3/responsive_peak/images/icon_anonymous_message.png)