- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
NiFi - ConvertCSVtoAVRO (without inferring schema) - how to rename the output file?
- Labels:
-
Apache NiFi
Created ‎01-20-2017 02:56 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am using ConvertCSVtoAVRO transformation in NiFi to obtain an avro file (from local to local address) with a predefined schema.
All the records successfully go through, however I cannot find a place in PutFile block (connected direclty to ConvertCSVtoAVRO) where I can change the filename.
Does anyone know how to do it?
Let's assume I have input.csv and want to obtain output.avro file.
Thanks, Michal
Created on ‎01-20-2017 03:05 PM - edited ‎08-19-2019 01:32 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can use an UpdateAttribute processor to change the filename.
However, this would end up with every file having the same filename.
Assuming each input filename is unique excpet has a .csv extension, you could do the following:
This would essentially replace the .csv extension with .avro while leaving the rest of the original filename unchanged.
Thanks,
Matt
Created ‎01-20-2017 02:58 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can use an UpdateAttribute processor and change the 'filename' attribute.
Created ‎01-20-2017 02:58 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Michal R,
What you are looking for can be achieved with an UpdateAttribute processor, and you just need to update the 'filename' attribute, this is the attribute used by the PutFile processor.
Hope this helps.
Created on ‎01-20-2017 03:05 PM - edited ‎08-19-2019 01:32 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can use an UpdateAttribute processor to change the filename.
However, this would end up with every file having the same filename.
Assuming each input filename is unique excpet has a .csv extension, you could do the following:
This would essentially replace the .csv extension with .avro while leaving the rest of the original filename unchanged.
Thanks,
Matt
