Scenario 1: Removing and regenerating a MySQL table index - 6.1

Talend Components Reference Guide

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
Data Governance
Data Quality and Preparation
Design and Development
Talend Studio

This scenario describes a four-component job that removes a table index, applies a select insert action onto a table then regenerates the index.

Linking the components

  1. Select and drop the following components onto the design workspace: tMysqlRow (x2), tRowGenerator, and tMysqlOutput.

  2. Link the first tMysqlRow to tRowGenerator using an OnComponentOk connection.

  3. Link tRowGenerator to tMysqlOutput using a Row > Main connection.

  4. Link tRowGenerator to the second tMysqlRow using an OnSubjobOk connection.

Configuring the components

  1. Select the tMysqlRow to fill in the DB Basic settings.

  2. In Property type as well in Schema, select the relevant DB entry in the list.

    The DB connection details and the table schema are accordingly filled in.

  3. Propagate the properties and schema details onto the other components of the Job.

    The query being stored in the Metadata area of the Repository, you can also select Repository in the Query type field and the relevant query entry.

  4. If you didn't store your query in the Repository, type in the following SQL statement to alter the database entries: drop index <index_name> on <table_name>

  5. Select the second tMysqlRow component, check the DB properties and schema.

  6. Type in the SQL statement to recreate an index on the table using the following statement: create index <index_name> on <table_name> (<column_name>)

    The tRowGenerator component is used to generate automatically the columns to be added to the DB output table defined.

  7. Select the tMysqlOutput component and fill in the DB connection properties either from the Repository or manually the DB connection details are specific for this use only. The table to be fed is named: comprehensive.

  8. The schema should be automatically inherited from the data flow coming from the tLogRow. Edit the schema to check its structure and check that it corresponds to the schema expected on the DB table specified.

    The Action on table is None and the Action on data is Insert.

    No additional Columns is required for this job.

Executing the Job

  1. Press Ctrl+S to save the Job.

  2. Press F6 to run the job.

    If you manage to watch the action on DB data, you can notice that the index is dropped at the start of the job and recreated at the end of the insert action.

    Related topics: tDBSQLRow properties.