Talend 简明教程

Talend - Job Design

这是业务模型的技术实现/图形化表示。在此设计中,一个或多个组件相互连接以运行数据集成过程。因此,当您在设计面板中拖拽组件并使用连接器连接它们时,作业设计将所有内容转换为代码并创建一个完整的可运行程序,从而形成数据流。

Creating a Job

在存储库窗口中,右键单击作业设计并单击创建作业。

creating job

提供作业的名称、目的和描述,然后单击完成。

description of job

您会看到作业已在作业设计下创建。

job design

现在,让我们使用此作业来添加、连接和配置组件。在此,我们将使用 Excel 文件作为输入并生成包含相同数据的 Excel 文件作为输出。

Adding Components to a Job

调色板中有几个可供选择的组件。还有一个搜索选项,您可以在其中输入组件的名称以选择它。

palette

由于我们在此将 Excel 文件作为输入,因此我们将从调色板中将 tFileInputExcel 组件拖拽到设计器窗口中。

designer window

现在,如果您单击设计器窗口上的任意位置,将出现一个搜索框。找到 tLogRow 并选择它以将其带入设计器窗口。

search box

最后,从调色板中选择 tFileOutputExcel 组件,并将其拖拽到设计器窗口中。

file output excel

现在,组件添加已完成。

new job

Connecting the Components

添加组件后,您必须连接它们。右键单击第一个组件 tFileInputExcel,然后将主线绘制到 tLogRow,如下所示。

connecting components

同样,右键单击 tLogRow,然后在 tFileOutputExcel 上绘制一条主线。现在,您的组件已连接。

components conected
draw main line

Configuring the components

在作业中添加并连接组件后,您需要对其进行配置。为此,双击第一个组件 tFileInputExcel 以对其进行配置。在文件名/流中提供输入文件的路径,如下所示。

If your 1st row in the excel is having the column names, put 1 in the Header option.

header option

Click Edit schema and add the columns and its type according to your input excel file. Click Ok after adding the schema.

adding schema

Click Yes.

propagate

In tLogRow component, click on sync columns and select the mode in which you want to generate the rows from your input. Here we have selected Basic mode with “,” as field separator.

progress information

Finally, in tFileOutputExcel component, give the path of file name where you want to store

sync columns

your output excel file with the sheet name. Click on sync columns.

Executing the Job

Once you are done with adding, connecting and configuring your components, you are ready to execute your Talend job. Click Run button to begin the execution.

basic run
log row

You will see the output in the basic mode with “,” separator.

basic mode

You can also see that your output is saved as an excel at the output path you mentioned.

output path