tNormalize - 6.1

Talend Open Studio for Big Data Components Reference Guide

EnrichVersion
6.1
EnrichProdName
Talend Open Studio for Big Data
task
Data Governance
Data Quality and Preparation
Design and Development
EnrichPlatform
Talend Studio

Function

Normalizes the input flow following SQL standard.

Purpose

tNormalize helps improve data quality and thus eases the data update.

tNormalize Properties

Component family

Processing/Fields

 

Basic settings

Schema and Edit Schema

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

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: You create and store the schema locally for this component only. Related topic: see Talend Studio User Guide.

 

 

Repository: You have already created the schema and stored it in the Repository. You can reuse it in various projects and Job designs. Related topic: see Talend Studio User Guide.

 

Column to normalize

Select the column from the input flow which the normalization is based on.

 

Item separator

Enter the separator which will delimit data in the input flow.

Note

The item separator is based on regular expressions, so the character "." (a special character for regular expression) should be avoided or used carefully here.

Advanced settings

Get rid of duplicated rows from output

Select this check box to deduplicate rows in the data of the output flow.

 

Use CSV parameters

Select this check box to include CSV specific parameters such as escape mode and enclosure character.

 

Discard the trailing empty strings

Select this check box to discard the trailing empty strings.

  Trim resulting values

Select this check box to trim leading and trailing whitespace from the resulting data.

Note

When both Discard the trailing empty string and Trim resulting values check boxes are selected, the former works first.

 

tStatCatcher Statistics

Select this check box to gather the Job processing metadata at the Job level as well as at each component level.

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.

Log4j

If you are using a subscription-based version of the Studio, 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

Due to license incompatibility, one or more JARs required to use this component are not provided. You can install the missing JARs for this particular component by clicking the Install button on the Component tab view. You can also find out and add all missing JARs easily on the Modules tab in the Integration perspective of your studio. For details, see https://help.talend.com/display/KB/How+to+install+external+modules+in+the+Talend+products or the section describing how to configure the Studio in the Talend Installation and Upgrade Guide.

Scenario: Normalizing data

This simple scenario illustrates a Job that normalizes a list of tags for Web forum topics, and displays the result in a table on the Run console.

This list is not well organized and it contains trailing empty strings, leading and trailing whitespace, and repeated tags, as shown below.

ldap,
  db2, jdbc driver,
grid computing,  talend architecture  ,
content, environment,,
tmap,,
eclipse,
database,java,postgresql,
tmap,
database,java,sybase,
deployment,,
repository,
database,informix,java

Setting up the Job

  1. Drop the following components from the Palette to the design workspace: tFileInputDelimited, tNormalize, tLogRow.

  2. Connect the components using Row > Main connections.

Configuring the components

  1. Double-click the tFileInputDelimited component to open its Basic settings view.

  2. In the File name field, specify the path to the input file to be normalized.

  3. Click the [...] button next to Edit schema to open the [Schema] dialog box, and set up the input schema by adding one column named Tags. When done, click OK to validate your schema setup and close the dialog box, leaving the rest of the settings as they are.

  4. Double-click the tNormalize component to open Basic settings view.

  5. Check the schema, and if necessary, click Sync columns to get the schema synchronized with the input component.

  6. Define the column the normalization operation is based on.

    In this use case, the input schema has only one column, Tags, so just accept the default setting.

  7. In the Advanced settings view, select the Get rid of duplicate rows from output, Discard the trailing empty strings, and Trim resulting values check boxes.

  8. In the tLogRow component, select the Print values in the cells of table radio button.

Saving and executing the Job

  1. Press Ctrl+S to save your Job.

  2. Click Run on the Run tab or press F6 to execute the Job.

    The list is tidied up, with duplicate tags, leading and trailing whitespace and trailing empty strings removed, and the result is displayed in a table cell on the console.