August 17, 2023

tUnite – Docs for ESB 5.x

tUnite

tUnite_icon32_white.png

tUnite Properties

Component
family

Orchestration

 

Function

Merges data from various sources, based on a common schema.

Warning

tUnite cannot exist in a data
flow loop. For instance, if a data flow goes through several
tMap components to generate
two flows, they cannot be fed to tUnite.

Purpose

Centralize data from
various and heterogeneous sources.

Basic
settings

Schema and Edit
Schema

A schema is a row description, it defines the number of fields to
be processed and passed on to the next component. The schema is
either Built-in or stored remotely
in the Repository.

Since version 5.6, both the Built-In mode and the Repository mode are
available in any of the Talend solutions.

Click Edit schema to make changes to the schema. If the
current schema is of the Repository type, three options are
available:

  • View schema: choose this option to view the
    schema only.

  • Change to built-in property: choose this option
    to change the schema to Built-in for local
    changes.

  • Update repository connection: choose this option to change
    the schema stored in the repository and decide whether to propagate the changes to
    all the Jobs upon completion. If you just want to propagate the changes to the
    current Job, you can select No upon completion and
    choose this schema metadata again in the [Repository
    Content]
    window.

Click Sync
columns
to retrieve the schema from the previous
component in the Job.

This component offers the advantage of the dynamic schema feature. This allows you to
retrieve unknown columns from source files or to copy batches of columns from a source
without mapping each column individually. For further information about dynamic schemas,
see Talend Studio
User Guide.

This dynamic schema feature is designed for the purpose of retrieving unknown columns
of a table and is recommended to be used for this purpose only; it is not recommended
for the use of creating tables.

 

 

Built-in: The
schema will be created and stored locally for this component only.
Related topic: see Talend Studio User
Guide
.

 

 

Repository: The
schema already exists and is stored in the Repository, hence can be
reused in various projects and Job designs. Related topic: see
Talend Studio User
Guide
.

Advanced
settings

tStatCatcher
Statistics

Select this check box to collect log data at the
component level.

Usage

This component is not
startable and requires one or several input components and an output
component.

Global Variables

ERROR_MESSAGE: the error message generated by the
component when an error occurs. This is an After variable and it returns a string. This
variable functions only if the Die on error check box is
cleared, if the component has this check box.

NB_LINE: the number of rows processed. This is an After
variable and it returns an integer.

A Flow variable functions during the execution of a component while an After variable
functions after the execution of the component.

To fill up a field or expression with a variable, press Ctrl +
Space
to access the variable list and choose the variable to use from it.

For further information about variables, see Talend Studio
User Guide.

Connections

Outgoing links (from this component to another):

Row: Main.

Trigger: Run if; On Component Ok;
On Component Error

Incoming links (from one component to this one):

Row: Main; Reject.

For further information regarding connections, see
Talend Studio User
Guide
.

Log4j

The activity of this component can be logged using the log4j feature. For more information on this feature, see Talend Studio User
Guide
.

For more information on the log4j logging levels, see the Apache documentation at http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html.

Limitation

n/a

Scenario: Iterate on files and merge the content

The following Job iterates on a list of files then merges their content and displays
the final 2-column content on the console.

Use_Case_tUnite1.png

Dropping and linking the components

  1. Drop the following components onto the design workspace: tFileList, tFileInputDelimited, tUnite
    and tLogRow.

  2. Connect the tFileList to the tFileInputDelimited using an Iterate connection and connect the other
    component using a row main link.

Configuring the components

  1. In the tFileList
    Basic settings view, browse to the
    directory, where the files to merge are stored.

    Use_Case_tUnite2.png

    The files are pretty basic and contain a list of countries and their
    respective score.

    Use_Case_tUnite5.png
  2. In the Case Sensitive field, select
    Yes to consider the letter case.

  3. Select the tFileInputDelimited component,
    and display this component’s Basic settings
    view.

    Use_Case_tUnite3.png
  4. Fill in the File Name/Stream field by
    using the Ctrl+Space bar combination to
    access the variable completion list, and selecting
    tFileList.CURRENT_FILEPATH from the global variable list to
    process all files from the directory defined in the tFileList.

  5. Click the Edit Schema button and set
    manually the 2-column schema to reflect the input files’ content.

    Use_Case_tUnite4.png

    For this example, the 2 columns are Country and
    Points. They are both nullable. The Country column is of
    String type and the
    Points column is of Integer type.

  6. Click OK to validate the setting and
    accept to propagate the schema throughout the Job.

  7. Then select the tUnite component and
    display the Component view. Notice that the
    output schema strictly reflects the input schema and is read-only.

  8. In the Basic settings view of tLogRow, select the Table option to display properly the output values.

Saving and executing the Job

  1. Press Ctrl+S to save your Job.

  2. Press F6, or click Run on the Run console to
    execute the Job.

    The console shows the data from the various files, merged into one single
    table.

    Use_Case_tUnite6.png

Document get from Talend https://help.talend.com
Thank you for watching.
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x