Field Flattener Processor

Field Flattener allows you to flatten a nested record to produce a record with no nested fields, it can also flatten specific list or map fields.

By default, the new flattened fields is separated by “_”

Let’s take an example of a nested JSON.

Specify a path of input json in the record, so that it flattens all nested structures until the nested path is flat.

For Example:

The JSON below contains nested fields under “Employee” such as “Id,” “Name,” “Permanent,” and “Address.” Using the Field Flattener, you can flatten these nested fields, including “Street,” “City,” and “Zipcode,” as shown in the example.

{ "Employee":{ "Id":123, "Name":"Steve Rogers", "Permanent":true, "Address":{ "Street":"El Camino Real", "City":"San Jose", "Zipcode":55014 }, "Role":"Developer" } }

After applying the Field Flattener, the nested fields are flattened into a single level.

flattened-json-output


Field Flattener Processor Configuration

To add Field Flattener processor into your pipeline, drag the processor to the canvas and right click on it to configure as explained below:

FieldDescription
Flatten PathFlatten list and map fields that contains additional nested list or map fields. Specify the path to the field, for example: Employee.
Top