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

Warning

This component is available in the Palette of the Studio only if you have subscribed to one of the Talend Platform solutions with Big Data.

Function

tHConvertFile converts data from one representation to another in a Spark environment.

Purpose

tHConvertFile uses Talend Data Mapper structures to perform a conversion from one representation to another, as a Spark Batch execution.

tHConvertFile properties in Spark Batch Jobs

Component family

Processing

 

Basic settings

Storage

To connect to an HDFS installation, select the Define a storage configuration component check box and then select the name of the component to use from those available in the drop-down list.

This option requires you to have previously configured the connection to the HDFS installation to be used, as described in the documentation for the tHDFSConfiguration component.

If you leave the Define a storage configuration component check box unselected, you can only convert files locally.

 

Configure Component

To configure the component, click the [...] button and, in the [Component Configuration] window, perform the following actions.

  1. Click the Select button next to the Record structure field and then, in the [Select a Structure] dialog box that opens, select the structure you want to use when converting your file and then click OK.

    This structure must have been previously created in Talend Data Mapper.

  2. Select the Input Representation to use from the drop-down list.

    Supported input formats are COBOL, EDI, Flat, IDocs, JSON and XML.

  3. Select the Output Representation to use from the drop-down list. The choices available for the Output representation depend on what you choose for the Input representation.

    Supported output formats are Avro, Flat, JSON and XML.

  4. Click Next.

  5. Tell the component where each new record begins. In order for you to be able to do so, you need to fully understand the structure of your data.

    Exactly how you do this varies depending on the input representation being used, and you will be presented with one of the following options.

    1. Select an appropriate record delimiter for your data. Note that you must specify this value without quotes.

      • Separator lets you specify a separator indicator, such as \n, to identify a new line.

        Supported indicators are \n for a Unix-type new line, \r\n for Windows and \r for Mac, and \t for tab characters.

      • Start with lets you specify the initial characters that indicate new record, such as <root.

        Start with also supports new lines, \n for a Unix-type new line, \r\n for Windows and \r for Mac, and \t for tab characters.

    2. If your input representation is COBOL, define the signature for the input record structure:

      • Min Size corresponds to the size in bytes of the smallest record. If you set this value too low, you may encounter performance issues, since the component will perform more checks than necessary when looking for a new record.

      • Max Size corresponds to the size in bytes of the largest record, and is used to determine how much memory is allocated to read the input.

      • Footer Size corresponds to the size in bytes of the footer, if any. At runtime, the footer will be ignored rather than being mistakenly included in the last record. Leave this field empty if there is no footer.

      • Click the Configure button to open the [Edit Signature] window, select the fields that define the signature of your record input structure (that is, to identify where a new record begins), update the Operation and Value columns as appropriate, and then click OK to return to the [Component Configuration] window.

  6. To test the signature with a sample file, click the [...] button, browse to the file you want to use as a sample, and then click Open.

    Testing the signature lets you check that the total number of records and their minimum and maximum length corresponds to what you expect based on your knowledge of the data. This step assumes you have a local subset of your data to use as a sample.

  7. Click Run to test your sample.

  8. Click Finish.

 

Input

Click the [...] button to define the path to where the input file is stored.

You can also enter the path manually, between quotes.

 

Output

Click the [...] button to define the path to where the output file will be stored.

You can also enter the path manually, between quotes.

 

Action

From the drop-down list, select:

  • Create if you want the conversion process to create a new file.

  • Overwrite if you want the conversion process to overwrite an existing file.

 

Open Structure Editor

Click the [...] button to open the structure for editing in the Structure Editor of Talend Data Mapper.

For more information, see Talend Data Mapper User Guide.

Usage

This component is used with a tHDFSConfiguration component which defines the connection to the HDFS storage, or as a standalone component for converting local files only.

Related scenarios

For a related scenario, see Scenario: Transforming data in a Spark environment.