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
Drop the following components from the Palette to the design workspace: tRiakConnection, tRiakInput, tFileOutputDelimited, and tRiakClose.
Connect tRiakConnection to tRiakInput using a Trigger > On Subjob Ok link.
Connect tRiakInput to tFileOutputDelimited using a Row > Main link.
Connect tFileOutputDelimited to tRiakClose using a Trigger > On Component Ok link.
Opening a connection to Riak
Double-click tRiakConnection to open its Basic settings view in the Component tab.
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
Double-click tRiakInput to open its Basic settings view in the Component tab.
Click Edit schema to define the structure of exported data. In this example, three columns are defined: id, company, and price.
Select the Use an existing connection check box and then select the connection you have configured earlier. In this example, it is tRiakConnection_1.
In the Bucket field, enter the name of the bucket from which the data will be exported, computer in this example.
Select the Output key to column check box , and select the desired column from the list. id is selected in this example.
In the Value columns table, click twice the button and select company and price from the list respectively.
Writing data into a local file
Double-click tFileOutputDelimited to open its Basic settings view in the Component tab.
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.
Select the Include Header check box.
Leave other settings as they are.