blob: b077779340d7aa4dbc781a1d75ace123e9283cd1 [file] [log] [blame]
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"></meta><title>SplitJson</title><link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css"></link></head><script type="text/javascript">window.onload = function(){if(self==top) { document.getElementById('nameHeader').style.display = "inherit"; } }</script><body><h1 id="nameHeader" style="display: none;">SplitJson</h1><h2>Description: </h2><p>Splits a JSON File into multiple, separate FlowFiles for an array element specified by a JsonPath expression. Each generated FlowFile is comprised of an element of the specified array and transferred to relationship 'split,' with the original file transferred to the 'original' relationship. If the specified JsonPath is not found or does not evaluate to an array element, the original file is routed to 'failure' and no files are generated.</p><h3>Tags: </h3><p>json, split, jsonpath</p><h3>Properties: </h3><p>In the list below, the names of required properties appear in <strong>bold</strong>. Any other properties (not in bold) are considered optional. The table also indicates any default values.</p><table id="properties"><tr><th>Display Name</th><th>API Name</th><th>Default Value</th><th>Allowable Values</th><th>Description</th></tr><tr><td id="name"><strong>JsonPath Expression</strong></td><td>JsonPath Expression</td><td></td><td id="allowable-values"></td><td id="description">A JsonPath expression that indicates the array element to split into JSON/scalar fragments.</td></tr><tr><td id="name"><strong>Null Value Representation</strong></td><td>Null Value Representation</td><td id="default-value">empty string</td><td id="allowable-values"><ul><li>empty string</li><li>the string 'null'</li></ul></td><td id="description">Indicates the desired representation of JSON Path expressions resulting in a null value.</td></tr></table><h3>Relationships: </h3><table id="relationships"><tr><th>Name</th><th>Description</th></tr><tr><td>failure</td><td>If a FlowFile fails processing for any reason (for example, the FlowFile is not valid JSON or the specified path does not exist), it will be routed to this relationship</td></tr><tr><td>original</td><td>The original FlowFile that was split into segments. If the FlowFile fails processing, nothing will be sent to this relationship</td></tr><tr><td>split</td><td>All segments of the original FlowFile will be routed to this relationship</td></tr></table><h3>Reads Attributes: </h3>None specified.<h3>Writes Attributes: </h3><table id="writes-attributes"><tr><th>Name</th><th>Description</th></tr><tr><td>fragment.identifier</td><td>All split FlowFiles produced from the same parent FlowFile will have the same randomly generated UUID added for this attribute</td></tr><tr><td>fragment.index</td><td>A one-up number that indicates the ordering of the split FlowFiles that were created from a single parent FlowFile</td></tr><tr><td>fragment.count</td><td>The number of split FlowFiles generated from the parent FlowFile</td></tr><tr><td>segment.original.filename </td><td>The filename of the parent FlowFile</td></tr></table><h3>State management: </h3>This component does not store state.<h3>Restricted: </h3>This component is not restricted.<h3>Input requirement: </h3>This component requires an incoming relationship.<h3>System Resource Considerations:</h3><table id="system-resource-considerations"><tr><th>Resource</th><th>Description</th></tr><tr><td>MEMORY</td><td>The entirety of the FlowFile's content (as a JsonNode object) is read into memory, in addition to all of the generated FlowFiles representing the split JSON. If many splits are generated due to the size of the JSON, or how the JSON is configured to be split, a two-phase approach may be necessary to avoid excessive use of memory.</td></tr></table></body></html>