Configure properties for the output, including the schema and output format.
The following table describes the output properties:
Property
Description
Schema
Schema that defines the structure of the hierarchical output.
To convert data to Avro, ORC, or Parquet format, click Auto-generate from sample file and create an intelligent structure model. For more information about intelligent structure models, see Intelligent structure models.
To convert data to JSON or XML format, select an existing hierarchical schema or click Create new schema. When you create a hierarchical schema for the Hierarchy Builder transformation, refer to Rules and guidelines for hierarchical schemas.
When you update the hierarchical schema, you can choose to retain the existing field mapping.
Determines whether the transformation keeps or omits null values in primitive JSON types. Applicable when you associate the transformation with a JSON-based schema.
Output Format
Format for the output data, either string or binary.
Write to file
Determines whether the transformation writes the data to a flat file. When you enable this option, enter the file path in the File path field.
You can parameterize the file path only when you enable the Optimize transformation property.
Tip: Write data to a flat file when the transformation processes a large amount of data and the output field size exceeds 100 MB.
Enable passthrough fields
Determines whether unmapped fields are passed to the downstream transformation.
If there is more than one upstream transformation connected to the Hierarchy Builder transformation, the transformation only passes through fields from the upstream transformation that was connected first.
Generate single output
Determines if the transformation generates a single JSON or XML structure containing all the output elements. By default, the transformation generates a JSON or XML output structure for each output element.
To generate a single output structure, map an incoming group to a recurring element in the hierarchy fields.
Consider the following rules and guidelines when you create a hierarchical schema to associate with a Hierarchy Builder transformation:
•The schema must be smaller than 10,000 elements.
•The schema can contain up to 10,000 fields.
•The schema can contain up to 20,000 groups.
•The schema can contain up to 20 levels of data hierarchy.
•To optimize performance, create a schema with fewer than 5,000 ports and fewer than 10 groups.
Single output example
You can configure the Hierarchy Builder transformation to generate a single output structure or output structures for each output element. For example, you're creating an XML file for employee contact information.
If you choose to generate a single output structure, the transformation outputs the following data:
Rules and guidelines for optimizing the transformation
Consider the following rules and guidelines when you optimize the processing performance in the output settings:
•When you generate a single output, ensure that you enable the Write to file option.
•When you write data to a file, you can parameterize the file path.
To parameterize the file path, you must add $$ as a prefix and | as a suffix to the parameter name before the file path. You can define the parameter by adding the file path in the [global] section in the downloaded parameters file.
The following image displays a file path that contains the parameter name along with its prefix and suffix:
•
•When you pass through fields from the upstream transformation and the passthrough ports include the FileName port, the transformation reads from the port and writes each hierarchical output to the filename specified by this port.