tSampleRow
Selects rows according to a list of single lines and/or a list of groups of
lines.
tSampleRow filters rows
according to line numbers.
tSampleRow Standard properties
These properties are used to configure tSampleRow running in the Standard Job framework.
The Standard
tSampleRow component belongs to the Processing family.
The component in this framework is available in all Talend
products.
Basic settings
Schema and Edit Schema |
A schema is a row description, it defines the number of fields to be processed Click Edit
Click Sync columns to retrieve the schema from This This |
 |
Built-in: You create the schema and store it |
 |
Repository: The schema already exists and is |
Range |
Enter a range using the relevant syntax to choose a list of single lines and/or |
Global Variables
Global Variables |
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 handles flows of data therefore it requires input and output |
Filtering rows and groups of rows
This scenario describes a three-component Job. A tRowGenerator is used to create random entries which are directly sent to a
tSampleRow where they will be filtered according to a
defined range. In this scenario, we suppose the input flow contains names of salespersons
along with their respective number of sold products and their years of presence in the
enterprise. The result of the filtering operation is displayed on the Run console.
Dropping and linking the components
-
Drop the following components from the Palette onto
the design workspace: tRowGenerator, tSampleRow, and tLogRow. - Connect the three components using Row > Main links.
Configuring the components
-
In the design workspace, select tRowgenerator, and
click the Component tab to define the basic settings
for tRowGenerator. -
Click the […] button next to Edit Schema to define the data you want to use as input. In
this scenario, the schema is made of five columns. - In the Basic settings view, click RowGenerator Editor to define the data to be generated.
-
In the RowGenerator Editor, specify the number of
rows to be generated in the Number of Rows for
RowGenerator field and click OK. The
RowGenerator Editor closes. -
In the design workspace, select tSampleRow and
click the Component tab to define the basic settings
for tSampleRow. -
In the Basic settings view, set the Schema to Built-In and click
Sync columns to retrieve the schema from the
tRowGenerator component. -
In the Range panel, set the filter to select your
rows using the correct syntax as explained. In this scenario, we want to select the
first and fifth lines along with the group of lines between 9 and 12. -
In the design workspace, select tLogRow and click
the Component tab to define its basic settings. For
more information about tLogRow, see tLogRow.
Saving and executing the Job
- Press Ctrl+S to save your Job.
-
Press F6, or click Run on the Run tab to execute the
Job.
The filtering result displayed on the console shows the first and fifth rows and the
group of rows between 9 and 12.