July 30, 2023

tDataShuffling – Docs for ESB 7.x

tDataShuffling

Shuffles the data from in an input table to protect the actual data while having a
functional data set. Data will remain usable for purposes such as testing and
training.

tDataShuffling replaces original values with other
values for the same column from a different row.

If you define one or several columns as the partition group, the whole
table is split into a given number of partitions. These partitions share
the same values in the columns partitioned. Then, the shuffling process
is applied independently to each partition. All partitions are merged
into one output table.

If you do not set columns as the partition group, the shuffling
process is applied to the whole input table.

In local mode, Apache Spark 1.4.0 and later versions are supported.

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

tDataShuffling Standard properties

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

The Standard
tDataShuffling 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.

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

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.

 

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

Shuffling columns

Define the groups of columns to be shuffled:

  • Column: Select the columns to be shuffled.

  • Group ID: Select the group identifier to group
    columns. The columns having the same group identifier are shuffled together.

    This field is set to 0 by default. This means that the column
    is not part of the shuffling process.

Advanced settings

Seed for random generator

Set a random number if you want to shuffle the data in the same
order in each execution of the Job. The seed is not set by default.

If you do not set the seed, the component creates a new random
seed for each Job execution. Repeating the execution with a different value for this field
will shuffle the data in a different order.

Buffer size

Type in the size of physical memory, in number of rows, you want to
allocate to processed data.

Partitioning columns

Add the columns used for partitioning the data.

The selected columns separate the shuffling process into small partitions. Only the rows
within a partition can be shuffled together.

tStat
Catcher
Statistics

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

Usage

Usage rule

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

Shuffling data values to restrict the use of actual sensitive data

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.

With the tDataShuffling component, you can shuffle
sensitive information to replace it with other values for the same column from a different
row, allowing production data to be safely used for purposes such as testing and
training.

This scenario describes a Job which uses:

  • the tFixedFlowInput component to generate
    personal data including credit card numbers,

  • the tDataShuffling component to shuffle original
    data and replace values with other values for the same column from a different
    row,

  • the tFileOutputExcel component to output the
    shuffled data set.

tDataShuffling_1.png

Setting up the Job

  1. Drop the following components from the Palette onto the design workspace: tFixedFlowInput, tDataShuffling and
    tFileOutputExcel.
  2. Connect the three components together using the Main links.

Configuring the input component

  1. Double-click tFixedFlowInput to open its
    Basic settings view in the Component tab.

    tDataShuffling_2.png

  2. Create the schema through the Edit Schema
    button.

    tDataShuffling_3.png

    In the open dialog box, click the [+] button
    and add the columns that will hold the initial input data: customer
    id
    , credit_card, lname,
    fname, mi,
    address1, city,
    state_province, postal_code,
    country, phone and
    email.
  3. Click OK.
  4. In the Number of rows field, enter
    1.
  5. In the Mode area, select the Use Inline Content option.
  6. In the Content table, enter the customer data
    you want to shuffle, for example:

Configuring the tDataShuffling component

  1. Double-click tDataShuffling to display the
    Basic settings view and define the component
    properties.

    tDataShuffling_4.png

  2. Click Sync columns to retrieve the schema
    defined in the input component.
  3. In the Shuffling columns table, click the
    [+] button to add four rows, and then:

    • in the Column, select the columns
      where data will be shuffled,

    • in the Group ID, select the group
      identifier for each column. The columns having the same group identifier
      are shuffled together.

    In the above example, there are two groups of columns to be
    shuffled:

    • Group ID 1: credit_card

    • Group ID 2: lname, fname and mi

    The Job will replace credit card numbers within the credit_card column with values from different rows. It will also keep
    last names, first names and middle initial values, from the lname, fname and mi
    columns together and replace them with values from different rows.

  4. Click the Advanced settings tab.

    tDataShuffling_5.png

    In the Partitioning columns table, click the
    [+] button to add one row.
    The Job will shuffle the original data rows sharing the same value for the
    partitioning columns.
    In the above example, the component is configured to apply the shuffling
    process to the rows sharing the same value for the country column.

Configuring the output component and executing the Job

  1. Double-click the tFileOutputExcel component
    to display the Basic settings view and define
    the component properties.

    tDataShuffling_6.png

  2. Set the destination file name as well as the sheet name and then select the
    Define all columns auto size check box.
  3. Save your Job and press F6 to execute
    it.

    The tDataShuffling component shuffles data in
    the selected columns and writes the result in an output file.
  4. Right-click the output component and select Data
    Viewer
    to display the shuffled data.

    tDataShuffling_7.png

    tDataShuffling outputs shuffled data.
    tDataShuffling shuffles values within the first
    group of columns (credit_card) and within the second group
    of columns (lname, fname and
    mi).
    The shuffling process only applies to the rows sharing the same values for the
    country column, as defined in the component advanced settings.
    Sensitive personal information in the input data has been shuffled but data
    still looks real and consistent. The shuffled data is still usable for purposes
    other than production.

Further restricting the use of sensitive data

When shuffling data, it is still advised to mask sensitive data. Remember also to
consider relationships between the columns when shuffling data and make sure the
original data set cannot be reconstructed.

In this scenario, last names and first names are grouped together but the email
adresses are not in the same group. Consequently, the email column
does not relate to the lname and fname
columns. Since the email column usually contains information about
first names and last names, it may help attackers to reconstruct the original
data.

Additionally, the address1, city and
email columns are not in any group, so they were not shuffled. This
means it is possible to infer, for example, that Robert Damstra lives at 1619 Stillman
Court, Lynnwood.

Using this scenario, you can restrict the use of actual sensitive data even more:

  • To avoid the use of real credit card numbers, you can mask credit card numbers
    using the tDataMasking component.

  • To avoid the identification of customers with their email addresses, you can
    mask email addresses using the tDataMasking
    component.

  • To make it more difficult to read real addresses, you can add the
    address1 and city columns in other
    groups.

Note:

As tDataShuffling is supported on the Spark
framework, you can convert this standard Job to a Spark Batch Job by editing the Job
properties. This way you do not need to redefine the settings of the components in
the Job.

tDataShuffling properties for Apache Spark Batch

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

The Spark Batch
tDataShuffling 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.

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

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.

 

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

Shuffling columns

Define the groups of columns to be shuffled:

  • Column: Select the columns to be shuffled.

  • Group ID: Select the group identifier to group
    columns. The columns having the same group identifier are shuffled together.

    This field is set to 0 by default. This means that the column
    is not part of the shuffling process.

Advanced settings

Seed for random generator

Set a random number if you want to shuffle the data in the same
order in each execution of the Job. The seed is not set by default.

If you do not set the seed, the component creates a new random
seed for each Job execution. Repeating the execution with a different value for this field
will shuffle the data in a different order.

Partitioning columns

Add the columns used for partitioning the data.

The selected columns separate the shuffling process into small partitions. Only the rows
within a partition can be shuffled together.

Use Timestamp format for Date type

Select this check box to output dates, hours, minutes and seconds contained in
your Date-type data. If you clear this check box, only years, months and days are
included in the output.

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.


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