July 30, 2023

tStandardizePhoneNumber – Docs for ESB 7.x

tStandardizePhoneNumber

Standardizes phone numbers according to given formats.

tStandardizePhoneNumber receives phone
number data from its preceding component and formats and standardizes these numbers
using a built-in Google libphonumber library, org.talend.libraries.google.libphonumber.

Depending on the Talend
product you are using, this component can be used in one, some or all of the following
Job frameworks:

tStandardizePhoneNumber Standard properties

These properties are used to configure tStandardizePhoneNumber running in the Standard Job framework.

The Standard
tStandardizePhoneNumber component belongs to the Data Quality family.

The component in this framework is available in Talend Data Management Platform, Talend Big Data Platform, Talend Real Time Big Data Platform, Talend Data Services Platform, Talend MDM Platform and in Talend Data Fabric.

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. When you create a Spark
Job, avoid the reserved word line when naming the
fields.

This component provides default columns. For further information, see
section Default columns.

 

Built-In: You create and store the schema locally for this component
only.

 

Repository: You have already created the schema and stored it in the
Repository. You can reuse it in various projects and Job designs.

Phone number

Select the column holding the phone numbers of interest from the input data.

Country code

Select the column holding the country codes (ISO 2) from the input data.

Note:

The input data processed by this component must be able to provide the two-letter ISO
country codes alongside the corresponding phone numbers of interest.

Customize

Select this check box to set a custom country code (ISO 2). Once selected, it disables the
Country code field and gives priority to the customized
country code for phone number standardization.

For example, if the input data provides a set of phone numbers with a wrong country code
or alternatively with no country code, then you can select this check box and type in the
country code you need for standardization.

Phone number format for output

Select the format to be used to standardize the phone numbers of interest. The available
options are:

E164

International

National

Advanced settings

Avoid comparison

Select this check box to deactivate the comparison performed between the input and the
output data at runtime. This could accelerate the execution process of the Job using this
component.

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

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.

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

Usage rule

This component is usually used as an intermediate component, and it requires an
input component and an output component.

Default columns

The following table presents details about the default columns provided by tStandardizePhoneNumber.

Tip: In addition to these default columns, you need to define more columns alongside in order for this component to receive the corresponding input data.

Columns

Description

StandardizedPhoneNumber

This column presents the standardized phone numbers.

IsValidPhoneNumber

This column indicates whether a phone number processed is
recognized as valid.

IsPossiblePhoneNumber

This column indicates whether a phone number processed is
supposed to be valid.

IsAlreadyStandard

This column indicates whether a phone number processed is
already standardized after comparing it with the output
standardized phone number.

PhoneNumberType

This column indicates the type of a processed phone number,
such as fixed line, toll free, etc.

ErrorMessage

This column presents the relative error message if a phone
number is unrecognizable.

Standardizing French phone numbers

This scenario applies only to Talend Data Management Platform, Talend Big Data Platform, Talend Real Time Big Data Platform, Talend Data Services Platform, Talend MDM Platform and Talend Data Fabric.

In this scenario, you use three components to standardize some French phone numbers
according to the French phone number format.

tStandardizePhoneNumber_1.png

The components to be used are:

  • tFixedFlowInput: this component is used to
    provide the input data composed of phone numbers to be processed and the French
    country code (FR).

  • tStandardizePhoneNumber: this component
    standardizes the phone numbers of interest.

  • tLogRow: this component displays the result
    of this standardization.

To replicate this scenario, proceed as the following sections illustrate:

Dropping and linking the components

To do this, proceed as follows:

  1. Drop tFixedFlowInput, tStandardizePhoneNumber and tLogRow from the Palette to
    the Design workspace.
  2. Right-click the tFixedFlowInput component
    to open the contextual menu and select Row >
    Main
    .
  3. Do the same to connect tStandardizePhoneNumber to tLogRow using a Row >
    Main
    link.

Then you can continue to configure these components.

Configuring the input data

To do this, proceed as follows:

  1. Double click tFixedFlowInput to open its
    Component view.

    tStandardizePhoneNumber_2.png

  2. Next to Edit schema, click the three-dot
    button to open the schema editor.

    tStandardizePhoneNumber_3.png

  3. Click the plus button to add two rows.
  4. In the Column column, rename these two
    newly added rows. In this scenario, name them phone and
    country respectively.
  5. Click OK to validate these changes and
    accept the propagation prompted by the dialog box that pops up.
  6. In the Mode area, select the Use Inline Table option to display the Inline Table.
  7. Under this table, click the plus button to add as much number of rows as
    you need. In this scenario, add 12 rows.
  8. In this table, type in, between quotation marks, phone numbers of various
    formats and the corresponding ISO 2-letter country code in the
    phone and the country columns
    respectively. In this scenario, they read as follows:

    tStandardizePhoneNumber_4.png

Configuring the standardization process

To do this, proceed as follows:

  1. Double click tStandardizePhoneNumber to
    open its Component view.

    tStandardizePhoneNumber_5.png

  2. If required, click Sync columns to
    retrieve the schema from the previous component.
  3. In the Phone number field, select
    phone from the drop-down list as this column holds
    the phone numbers to be processed.
  4. In the Country
    code field, select
    country
    from the drop-down list as this column provides the
    country code to be used. In this scenario, this code is the French country
    code FR.
  5. In the Phone number format for output
    field, select National as you need to
    standardize these phone numbers according to the national standard format of
    France.

Executing the Job

Press F6 to run this Job.

You can read the execution result in the console of the Run view.

tStandardizePhoneNumber_6.png

From this result table, you can find that the first input record
0147045670, for example, is standardized as 01 47
04 56 70
according to the French phone number format and this number
is of FIXED LINE.

tStandardizePhoneNumber properties for Apache Spark Batch

These properties are used to configure tStandardizePhoneNumber running in the Spark Batch Job framework.

The Spark Batch
tStandardizePhoneNumber component belongs to the Data Quality family.

The component in this framework is available in all Talend Platform products with Big Data and in Talend Data Fabric.

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. When you create a Spark
Job, avoid the reserved word line when naming the
fields.

This component provides default columns. For further information, see
section Default columns.

 

Built-In: You create and store the schema locally for this component
only.

 

Repository: You have already created the schema and stored it in the
Repository. You can reuse it in various projects and Job designs.

Phone number

Select the column holding the phone numbers of interest from the input data.

Country code

Select the column holding the country codes (ISO 2) from the input data.

Note:

The input data processed by this component must be able to provide the two-letter ISO
country codes alongside the corresponding phone numbers of interest.

Customize

Select this check box to set a custom country code (ISO 2). Once selected, it disables the
Country code field and gives priority to the customized
country code for phone number standardization.

For example, if the input data provides a set of phone numbers with a wrong country code
or alternatively with no country code, then you can select this check box and type in the
country code you need for standardization.

Phone number format for output

Select the format to be used to standardize the phone numbers of interest. The available
options are:

E164

International

National

Advanced settings

Avoid comparison

Select this check box to deactivate the comparison performed between the input and the
output data at runtime. This could accelerate the execution process of the Job using this
component.

Global Variables

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.

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

Usage rule

This component is used as an intermediate step.

This component, along with the Spark Batch component Palette it belongs to,
appears only when you are creating a Spark Batch Job.

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

Spark Connection

In the Spark
Configuration
tab in the Run
view, define the connection to a given Spark cluster for the whole Job. In
addition, since the Job expects its dependent jar files for execution, you must
specify the directory in the file system to which these jar files are
transferred so that Spark can access these files:

  • Yarn mode (Yarn client or Yarn cluster):

    • When using Google Dataproc, specify a bucket in the
      Google Storage staging bucket
      field in the Spark configuration
      tab.

    • When using HDInsight, specify the blob to be used for Job
      deployment in the Windows Azure Storage
      configuration
      area in the Spark
      configuration
      tab.

    • When using Altus, specify the S3 bucket or the Azure
      Data Lake Storage for Job deployment in the Spark
      configuration
      tab.
    • When using Qubole, add a
      tS3Configuration to your Job to write
      your actual business data in the S3 system with Qubole. Without
      tS3Configuration, this business data is
      written in the Qubole HDFS system and destroyed once you shut
      down your cluster.
    • When using on-premise
      distributions, use the configuration component corresponding
      to the file system your cluster is using. Typically, this
      system is HDFS and so use tHDFSConfiguration.

  • Standalone mode: use the
    configuration component corresponding to the file system your cluster is
    using, such as tHDFSConfiguration or
    tS3Configuration.

    If you are using Databricks without any configuration component present
    in your Job, your business data is written directly in DBFS (Databricks
    Filesystem).

This connection is effective on a per-Job basis.

Related scenarios

No scenario is available for the Spark Batch version of this component
yet.

tStandardizePhoneNumber properties for Apache Spark Streaming

These properties are used to configure tStandardizePhoneNumber running in the Spark Streaming Job framework.

The Spark Streaming
tStandardizePhoneNumber component belongs to the Data Quality family.

This component is available in Talend Real Time Big Data Platform and Talend Data Fabric.

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. When you create a Spark
Job, avoid the reserved word line when naming the
fields.

This component provides default columns. For further information, see
section Default columns.

 

Built-In: You create and store the schema locally for this component
only.

 

Repository: You have already created the schema and stored it in the
Repository. You can reuse it in various projects and Job designs.

Phone number

Select the column holding the phone numbers of interest from the input data.

Country code

Select the column holding the country codes (ISO 2) from the input data.

Note:

The input data processed by this component must be able to provide the two-letter ISO
country codes alongside the corresponding phone numbers of interest.

Customize

Select this check box to set a custom country code (ISO 2). Once selected, it disables the
Country code field and gives priority to the customized
country code for phone number standardization.

For example, if the input data provides a set of phone numbers with a wrong country code
or alternatively with no country code, then you can select this check box and type in the
country code you need for standardization.

Phone number format for output

Select the format to be used to standardize the phone numbers of interest. The available
options are:

E164

International

National

Advanced settings

Avoid comparison

Select this check box to deactivate the comparison performed between the input and the
output data at runtime. This could accelerate the execution process of the Job using this
component.

Global Variables

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.

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

Usage rule

This component, along with the Spark Streaming component Palette it belongs to, appears
only when you are creating a Spark Streaming Job.

This component is used as an intermediate step.

You need to use the Spark Configuration tab in the
Run view to define the connection to a given Spark cluster
for the whole Job.

This connection is effective on a per-Job basis.

For further information about a
Talend
Spark Streaming Job, see the sections
describing how to create, convert and configure a
Talend
Spark Streaming Job of the

Talend Open Studio for 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.

Spark Connection

In the Spark
Configuration
tab in the Run
view, define the connection to a given Spark cluster for the whole Job. In
addition, since the Job expects its dependent jar files for execution, you must
specify the directory in the file system to which these jar files are
transferred so that Spark can access these files:

  • Yarn mode (Yarn client or Yarn cluster):

    • When using Google Dataproc, specify a bucket in the
      Google Storage staging bucket
      field in the Spark configuration
      tab.

    • When using HDInsight, specify the blob to be used for Job
      deployment in the Windows Azure Storage
      configuration
      area in the Spark
      configuration
      tab.

    • When using Altus, specify the S3 bucket or the Azure
      Data Lake Storage for Job deployment in the Spark
      configuration
      tab.
    • When using Qubole, add a
      tS3Configuration to your Job to write
      your actual business data in the S3 system with Qubole. Without
      tS3Configuration, this business data is
      written in the Qubole HDFS system and destroyed once you shut
      down your cluster.
    • When using on-premise
      distributions, use the configuration component corresponding
      to the file system your cluster is using. Typically, this
      system is HDFS and so use tHDFSConfiguration.

  • Standalone mode: use the
    configuration component corresponding to the file system your cluster is
    using, such as tHDFSConfiguration or
    tS3Configuration.

    If you are using Databricks without any configuration component present
    in your Job, your business data is written directly in DBFS (Databricks
    Filesystem).

This connection is effective on a per-Job basis.

Related scenarios

No scenario is available for the Spark Streaming version of this component
yet.


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