Creating a Job script to aggregate and sort scores - 6.5

Talendジョブスクリプトリファレンス

author
Talend Documentation Team
EnrichVersion
6.5
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 Real-Time Big Data Platform
task
ジョブデザインと開発 > ジョブデザイン
EnrichPlatform
Talend CommandLine
Talend Studio

This example shows how to write a Job script to define a Job that will aggregate the a student's scores of different months and then sort the scores based on the total score of each subject.

The Job will contain the following components:

  • three tFileInputDelimited components, to read the source files that contain the scores of three months: scores_month1.csv, scores_month2.csv, and scores_month3.csv. Each of the source files contains two columns, as shown below.

    scores_month1.csv:

    subject;score
    Math;99
    English;89
    Computer;92
    Arts;93
    History;91

    scores_month2.csv:

    subject;score
    Math;98
    English;97
    Computer;94
    Arts;96
    History;95

    scores_month3.csv:

    subject;score
    Math;95
    English;96
    Computer;96
    Arts;92
    History;98
  • a tUnite component, to merge the three input flows into one.

  • a tAggregateRow component, to aggregate the scores to get the total score, the average score, and highest scores, and the lowest scores of each subject in three months.

  • a tSortRow component, to sort the scores based on the total score of each subject.

  • a tLogRow component, to display the aggregation and sorting results.