Scenario: Exporting data from a Riak bucket to a local file - 6.1

Talend Components Reference Guide

EnrichVersion
6.1
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

The following scenario describes a Job which reads data from a Riak bucket and writes it into a local txt file.

Prerequisites: The Riak bucket from which you want to export data already exists. In this example, the data from the bucket computer will be exported and the bucket has already imported the following data:

id; company; brand; price; owner
001; Dell; Inspiron 15; 299; Amanda
002; Dell; Inspiron 15R; 549; Linda
003; HP; Pavilion 500-210qe; 539; Marina
004; HP; Pavilion 500-075; 599; Diana

Dropping and linking components

  1. Drop the following components from the Palette to the design workspace: tRiakConnection, tRiakInput, tFileOutputDelimited, and tRiakClose.

  2. Connect tRiakConnection to tRiakInput using a Trigger > On Subjob Ok link.

  3. Connect tRiakInput to tFileOutputDelimited using a Row > Main link.

  4. Connect tFileOutputDelimited to tRiakClose using a Trigger > On Component Ok link.

Configuring the components

Opening a connection to Riak

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

  2. In the Nodes table, enter the information of a Riak cluster you want to connect to.

Exporting data from a Riak bucket to a local file

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

  2. Click Edit schema to define the structure of exported data. In this example, three columns are defined: id, company, and price.

  3. Select the Use an existing connection check box and then select the connection you have configured earlier. In this example, it is tRiakConnection_1.

  4. In the Bucket field, enter the name of the bucket from which the data will be exported, computer in this example.

  5. Select the Output key to column check box , and select the desired column from the list. id is selected in this example.

  6. In the Value columns table, click twice the button and select company and price from the list respectively.

Writing data into a local file

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

  2. In the File Name field, enter the full path to the local file in which you want to store the exported data, D:/Output/computer.txt in this example.

  3. Select the Include Header check box.

  4. Leave other settings as they are.

Closing the connection to Riak

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

  2. Select the connection you want to close from the Component List, tRiakConnection_1 in this example.

Saving and executing the Job

  1. Press Ctrl+S to save your Job.

  2. Execute the Job by pressing F6 or clicking Run on the Run tab.

  3. Go to the local directory where the file is stored and check the exported data from the Riak bucket.