tRiakInput
Extracts the desired data from a bucket in a Riak node so as to store or apply
changes to the data.
tRiakInput reads data from a Riak
bucket and send data in the Talend flow.
tRiakInput Standard properties
These properties are used to configure tRiakInput running in the Standard Job framework.
The Standard
tRiakInput component belongs to the Big Data and the Databases NoSQL families.
The component in this framework is available in all Talend products with Big Data
and in Talend Data Fabric.
Basic settings
Schema and Edit Schema |
A schema is a row description. It defines the number of fields Click Edit
|
Use existing connection |
Select this check box and in the Component List click the relevant connection component to If you select the Use an existing |
Nodes |
Fill in the information required for a connection to a Riak
One example of the URL for accessing a Riak node is http://127.0.0.1:8098/riak. For more information about the concepts related to Riak, see https://docs.basho.com/riak/kv/2.2.0/learn/concepts/. |
Bucket |
Type in the name of the bucket from which you want to read |
Key |
Type in the key which is associated with the data that you want to |
Output key to column |
Select this check box and from the list select the desired column |
Values column |
Customize the columns to which the values will be output. |
Advanced settings
tStatCatcher Statistics |
Select this check box to gather the Job processing metadata at the |
Global Variables
Global Variables |
NB_LINE: the number of rows read by an input component or
ERROR_MESSAGE: the error message generated by the A Flow variable functions during the execution of a component while an After variable To fill up a field or expression with a variable, press Ctrl + For further information about variables, see |
Usage
Usage rule |
This component always needs an output link. |
Exporting data from a Riak bucket to a local file
This scenario applies only to Talend products with Big Data.
The following scenario describes a Job which reads data from a Riak bucket and
writes it into a local txt file.
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:
1 2 3 4 5 |
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
- 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.
Configuring the components
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
thebutton 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.
Closing the connection to Riak
-
Double-click tRiakClose to open its
Basic settings view in the Component tab. - Select the connection you want to close from the Component List, tRiakConnection_1 in this example.
Saving and executing the Job
- Press Ctrl+S to save your Job.
-
Execute the Job by pressing F6 or
clicking Run on the Run tab. -
Go to the local directory where the file is stored and check the exported
data from the Riak bucket.