Warning
This component will be available in the Palette of the studio on the condition that you have subscribed to
one of the Talend solutions with Big
Data.
Component family |
Big Data / Hadoop |
|
Function |
This component allows you to sort a relation based on one or more |
|
Purpose |
The tPigSort component is used to |
|
Basic settings |
Schema and Edit |
A schema is a row description. It defines the number of fields to be processed and passed on Since version 5.6, both the Built-In mode and the Repository mode are Click Edit schema to make changes to the schema. If the
|
|
|
Built-in: The schema will be |
|
|
Repository: The schema already |
|
Sort key |
Click the Add button beneath the |
Advanced settings |
Increase parallelism |
Select this check box to set the number of reduce tasks for the |
|
tStatCatcher Statistics |
Select this check box to gather the Job processing metadata at the |
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 Talend Studio |
|
Usage |
This component is commonly used as intermediate step together with |
|
Prerequisites |
The Hadoop distribution must be properly installed, so as to guarantee the interaction
For further information about how to install a Hadoop distribution, see the manuals |
|
Log4j |
The activity of this component can be logged using the log4j feature. For more information on this feature, see Talend Studio User For more information on the log4j logging levels, see the Apache documentation at http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html. |
|
Limitation |
Knowledge of Pig scripts is required. |
This scenario describes a three-component Job that sorts rows of data based on one or
more sorting conditions and stores the result into a local file.
-
Drop the following components from the Palette to the design workspace: tPigSort, tPigLoad,
tPigStoreResult. -
Connect tPigLoad to tPigFilterRow using a Row > Pig
Combine connection. -
Connect tPigFilterRow to tPigStoreResult using a Row
> Pig Combine connection.
-
Double-click tPigLoad to open its
Basic settings view. -
Click the […] button next to Edit schema to add columns for tPigLoad.
-
Click the [+] button to add
Name, Country and
Age and click OK
to save the setting. -
Select Local from the Mode area.
-
Fill in the Input filename field with the
full path to the input file.In this scenario, the input file is CustomerList
that contains rows of names, country names and age. -
Select PigStorage from the Load function list.
-
Leave rest of the settings as they are.
-
Double-click tPigSort to open its
Basic settings view. -
Click Sync columns to retrieve the schema
structure from the preceding component. -
Click the [+] button beneath the
Sort key table to add a new sort key.
Select Age from the Column list and select ASC
from the Order list.This sort key will sort the data in CustomerList in
ascending order based on Age.
-
Double-click tPigStoreResult to open its
Basic settings view. -
Click Sync columns to retrieve the schema
structure from the preceding component. -
Select Remove result directory if
exists. -
Fill in the Result file field with the
full path to the result file.In this scenario, the result of filter is saved in
Lucky_Customer file. -
Select PigStorage from the Store function list.
-
Leave rest of the settings as they are.