August 17, 2023

tDenormalize – Docs for ESB 5.x

tDenormalize

tDenormalize.png

tDenormalize Properties

Component family

Processing/Fields

 

Function

Denormalizes the input flow based on one column.

Purpose

tDenormalize helps synthesize the
input flow.

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.

 

 

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 flowcharts. Related topic: see
Talend Studio User
Guide
.

 

To denormalize

In this table, define the parameters used to denormalize your
columns.

Column: Select the column to
denormalize.

Delimiter: Type in the separator
you want to use to denormalize your data between double
quotes.

Merge same value: Select this check
box to merge identical values.

Advanced settings

tStatCatcher Statistics

Select this check box to collect the log data at component
level. Note that this check box is
not available in the Map/Reduce version of the
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 read by an input component or
transferred to an output component. 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.

Usage

This component can be used as intermediate step in a data
flow.

Usage in Map/Reduce Jobs

If you have subscribed to one of the Talend solutions with Big Data, you can also
use this component as a Map/Reduce component. In a Talend Map/Reduce Job, this
component is used as an intermediate step and other components used along with it must be
Map/Reduce components, too. They generate native Map/Reduce code that can be executed
directly in Hadoop.

For further information about a Talend Map/Reduce Job, see the sections
describing how to create, convert and configure a Talend Map/Reduce Job of the
Talend Big Data Getting Started Guide.

Note that in this documentation, unless otherwise explicitly stated, a scenario presents
only Standard Jobs, that is to say traditional Talend data
integration Jobs, and non Map/Reduce Jobs.

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 1: Denormalizing on one column

This scenario illustrates a Job denormalizing one column in a delimited file.

Use_Case_tDenormalizePerl1.png
  • Drop the following components: tFileInputDelimited, tDenormalize, tLogRow from the
    Palette to the design workspace.

  • Connect the components using Row main
    connections.

  • On the tFileInputDelimited Component view, set the filepath to the file to be
    denormalized.

Use_Case_tDenormalizePerl2.png
  • Define the Header, Row
    Separator
    and Field Separator
    parameters.

  • The input file schema is made of two columns, Fathers and
    Children.

Use_Case_tDenormalizePerl3.png
  • In the Basic settings of tDenormalize, define the column that contains
    multiple values to be grouped.

  • In this use case, the column to denormalize is
    Children.

Use_Case_tDenormalizePerl4.png
  • Set the Delimiter to separate the grouped
    values. Beware as only one column can be denormalized.

  • Select the Merge same value check box, if you
    know that some values to be grouped are strictly identical.

  • Save your Job and press F6 to execute
    it.

Use_Case_tDenormalizePerl5.png

All values from the column Children (set as column to
denormalize) are grouped by their Fathers column. Values are
separated by a comma.

Scenario 2: Denormalizing on multiple columns

This scenario illustrates a Job denormalizing two columns from a delimited
file.

Use_Case_tDenormalizeJava1.png
  • Drop the following components: tFileInputDelimited, tDenormalize, tLogRow from the
    Palette to the design workspace.

  • Connect all components using a Row main
    connection.

  • On the tFileInputDelimited
    Basic settings panel, set the filepath to the
    file to be denormalized.

Use_Case_tDenormalizeJava2.png
  • Define the Row and Field separators, the Header and other information if required.

  • The file schema is made of four columns including: Name, FirstName, HomeTown, WorkTown.

Use_Case_tDenormalizeJava3.png
  • In the tDenormalize component Basic settings, select the columns that contain the
    repetition. These are the column which are meant to occur multiple times in the
    document. In this use case, FirstName,
    HomeCity and WorkCity are the
    columns against which the denormalization is performed.

  • Add as many line to the table as you need using the plus button. Then select
    the relevant columns in the drop-down list.

Use_Case_tDenormalizeJava4.png
  • In the Delimiter column, define the separator
    between double quotes, to split concanated values. For
    FirstName column, type in “#”, for
    HomeCity, type in “§”, ans for
    WorkCity, type in “¤”.

  • Save your Job and press F6 to execute
    it.

Use_Case_tDenormalizeJava5.png
  • The result shows the denormalized values concatenated using a comma.

  • Back to the tDenormalize components Basic settings, in the To denormalize table, select
    the Merge same value check box to remove the
    duplicate occurrences.

  • Save your Job again and press F6 to execute
    it.

Use_Case_tDenormalizeJava6.png

This time, the console shows the results with no duplicate instances.


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