Skip to content

JSON UNROLL SYNTH

Description

The JSON UNROLL SYNTH processor is designed to unroll JSON list elements into separate block instances during the consolidation phase of data processing. This processor is particularly useful for handling JSON data structures that contain arrays of objects, allowing each object within the array to be treated as an individual event. This can be particularly beneficial for data sources that produce JSON arrays.


Config Location

To configure the JSON UNROLL SYNTH processor, you need to define it within the consDPProcessors section of your data point configuration within the schema. This involves specifying the processor name and entity.


Supported Data Types

  • JSON

Config Requirements

Config ({}) options are required for the JSON UNROLL SYNTH processor. If no configuration is provided or if the configuration is improperly set up, a block violation will be thrown. For more information on Apiro violations and their appearance in the Apiro UI or logs, refer to the violations section.


Example Config

Below is an example of how to configure the JSON UNROLL SYNTH processor in XML format:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
<dataPoint name="DATA" dataType="JSON">
    <consDPProcessors>
        <consDPProcessor name="UNROLL" entity="JSON_UNROLL_SYNTH">
            <config>
                <![CDATA[
                    {
                        "synSchema":"schem1",
                        "listAt":"ID",
                        "indexDictionary":"ID",
                        "keyDictionaryFrom":"ID",
                        "keyDictionaryTo":"QUANTITY",
                        "transfers":{
                            "tran1":"TRANSFER1",
                            "tran2":"TRANSFER2",
                            "tran3":"TRANSFER3"
                        }
                    }
                ]]>
            </config>
        </consDPProcessor>
    </consDPProcessors>
</dataPoint>

Example Result

Upon successful configuration and execution, the JSON UNROLL SYNTH processor will unroll the JSON list elements specified in the "DATA" data point, creating separate block instances for each object within the array. This allows for more granular processing and analysis of the data.


Config Parameters

name acceptable values comment
synSchema A string representing the schema or structure of the unrolled data. This defines the structure of the unrolled data.
listAt A string specifying the path to the array within the JSON structure. This identifies the array to be unrolled.
indexDictionary A string specifying the field to use as the index for unrolled elements. This field will be used to index the unrolled elements.
keyDictionaryFrom A string specifying the source field for key dictionary mapping. This field will be used as the source for key dictionary mapping.
keyDictionaryTo A string specifying the target field for key dictionary mapping. This field will be used as the target for key dictionary mapping.
transfers A JSON object mapping transfer names to their corresponding data points. This defines the mapping of transfers to data points.

Common Mistakes

  • Ensure that the processor name and entity are correctly defined in the configuration to ensure that the processor is correctly identified and applied during the data processing pipeline.
  • Verify that the configuration parameters within the <config> tag are correctly written and match the expected format and values.
  • Remember that the configuration for the JSON UNROLL SYNTH processor is required. If no configuration, or improper configuration is provided then a block violation will be thrown.