tDataShuffling - 6.3

Talend Components Reference Guide

EnrichVersion
6.3
EnrichProdName
Talend Big Data
Talend Big Data Platform
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for Big Data
Talend Open Studio for Data Integration
Talend Open Studio for Data Quality
Talend Open Studio for ESB
Talend Open Studio for MDM
Talend Real-Time Big Data Platform
task
Data Governance
Data Quality and Preparation
Design and Development
EnrichPlatform
Talend Studio

Function

tDataShuffling shuffles the data from an input table. It 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.

Purpose

tDataShuffling enables you to shuffle 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.

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

  • Standard: see tDataShuffling properties.

    The component in this framework is available when you have subscribed to one of the Talend Platform products or Talend Data Fabric.

  • Spark Batch: see tDataShuffling properties in Spark Batch Jobs.

    The component in this framework is available when you have subscribed to any Talend Platform product with Big Data or Talend Data Fabric.

tDataShuffling properties

Component family

Data Quality

 

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 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. 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.

 

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. This field is set to 12345678 by default.

Repeating the execution with a different value for this field will shuffle the data in a different order. Keep this field empty if you want the data to be shuffled in random order each time you execute the Job.

 

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.

 

tStatCatcher Statistics

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

Usage

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

Limitation

n/a

Scenario: Shuffling data values to restrict the use of actual sensitive data

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.

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.

  2. Create the schema through the Edit Schema button.

    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:

    0|4244487462024688|Nowmer|Sheri|A.|2433 Bailey Road|Tlaxiaco|Oaxaca|15057|Mexico|271-555-9715|SheriNowmer@@Tlaxiaco.org
    1|3458687462024688|Nowmer|Alan|A.|2433 Bailey Road|Tlaxiaco|Oaxaca|15057|Mexico|271-555-9715|AlanNowmer@Tlaxiaco.org.org
    2|4639587470586299|Whelply|Derrick|I.|2219 Dewing Avenue|Sooke|BC|17172|Canada|211-555-7669|DerrickWhelply@Sooke.org
    3|2541387475757600|Derry|Jeanne||7640 First Ave.|Issaquah|WA|73980|USA|656-555-2272|JeanneDerry@Issaquah.org
    4|7845987500482201|Spence|Michael|J.|337 Tosca Way|Burnaby|BC|74674|Canada|929-555-7279|MichaelSpence@Burnaby.org
    5|1547887514054179|Gutierrez|Maya||8668 Via Neruda|Novato|CA|57355|$$#|387-555-7172|MayaGutierrez@Novato.org
    6|5469887517782449|Damstra|Robert|F.|1619 Stillman Court|Lynnwood|WA|90792|$$#|922-555-5465|RobertDamstra@Lynnwood.org
    7|54896387521172800|Kanagaki|Rebecca||2860 D Mt. Hood Circle|San Andres|DF|13343|Mexico|515-555-6247|RebeccaKanagaki@Tlaxiaco.org
    8|47859687539744377|Brunner|Kim|H.|6064 Brodia Court|San Andres|DF|12942|Mexico|411-555-6825|Kim@Brunner@San Andresorg
    9|35698487544797658|Blumberg|Brenda|C.|7560 Trees Drive|Sooke|BC|$$|Canada|815-555-3975|BrendaBlumberg@Richmond.org
    10|36521487568712234|Stanz|Darren|M.|1019 Kenwal Rd.|$$#|OR|82017|USA|847-555-5443|DarrenStanz@Lake Oswego.org
    ...

Configuring the tDataShuffling component

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

  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.

    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.

  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.