Union transformation is used to combine incoming data from two or more inputs into a single output. Any duplicate records are preserved in the Union’s output. Union transformation functions similar to union operator in a SQL query. A union transformation object has multiple input nodes and a single output node. Each input node receives data from a different set transformation. An input node in a union transformation cannot receive data from two different set transformations.
Use Union Transformation to combine data from two or more incoming streams. If inputs are sorted and you need the result to be sorted, Merge Transformation is a better way of accomplishing that.
To add a Union transformation, drag the Union object from the Transformations group in the Flow toolbox and drop it on the dataflow.
This is what a Union transformation object looks like:
An example of how a Union transformation object is used in a dataflow is shown below.
To configure the properties of a Union object after it is added to the dataflow, right-click on it and select Properties from the context menu. The following properties are available:
Meta Object Builder screen:
Meta Object Builder screen allows you to add or remove fields in the field layout, as well as select their data type. The fields added in Meta Object Builder will show in the Output node, as well as all Input nodes inside the object box.
Union Transformation Properties screen:
Enter your input items in the grid. The name you assign to an input item should help you remember its purpose. Each input item will have its own Input node in the object box, so that it can be mapped to receive data from an upstream object on the dataflow.
Note: Entering input items in the grid should be done prior to mapping the Union object. Once you close the Properties dialog box, each input item will have its own Input node in the object box.
General Options screen:
This screen shares the options common to most objects on the dataflow:
Clear Incoming Record Messages
When this option is on, any messages coming in from objects preceding the current object will be cleared. This is useful when you need to capture record messages in the log generated by the current object and filter out any record messages generated earlier in the dataflow.
Do Not Process Records with Errors
When this option is on, records with errors will not be output by the object. When this option is off, records with errors will be output by the object, and a record message will be attached to the record. This record message can then feed into downstream objects on the dataflow, for example a destination file that will capture record messages, or a log that will capture the messages and as well as collect their statistics.
The Comments input allows you to enter comments associated with this object.