Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Getting one json file and transform it with NiFi

Highlighted

Getting one json file and transform it with NiFi

New Contributor

Hi,

I'm a newbie un NiFi world and I'm interested on doing some operations with this tool. I have a JSON file with some fields (Id, Name, Country, time), and I'd like to generate another JSON with only the fields I'm interested in: Id and Name, to load it later on a Casandra DB table. How can I achieve this?

Any help wil be very appreciated :)

1 REPLY 1

Re: Getting one json file and transform it with NiFi

You can remove fields with any record-based processor, in this case probably ConvertRecord is the most straightforward. You'd use a JsonTreeReader with your incoming schema, and a JsonRecordSetWriter with a schema with the unwanted fields removed. Fields that don't exist in the outgoing schema are not written to the flow file.