Talend tDenormalize

我们可以使用此 Talend tDenormalize 来反规范化或展平列。为了演示 Talend tDenormalize,我将使用此文本文件。如您所见,每个员工有多个 Sales 值,我们的任务是反规范化该 Sales 列。

Source Text File

Talend tDenormalize 示例

在开始创建 tDenormalize 作业之前,我们创建了反规范化的源文本文件元数据。我们将这些 DenormalizedSource 元数据用作规范化源。

我将使用该由分隔符分隔的元数据作为 Talend Denormalize 组件的源。

Configure the Source text file in the workflow

接下来,将 tDenormalize 拖放到作业窗口中。

Add Talend tDenormalize to Workflow to Normalize the Data

从下面的 tDenormalize 组件选项卡中可以看到,它有一个用于添加所需列的窗口。这是您想要反规范化的列,以及您希望使用的分隔符。请使用 + 按钮添加反规范化的列。

请点击 Talend Denormalization 编辑模式按钮以检查输入和输出列。

Click the Talend tDenormalize Edit Schema to check the Normalize Columns

我们将 Sales 添加为反规范化列,并将分号用作分隔符。

Add Columns in Talend tDenormalize to Workflow to Normalize the Data

接下来,我们使用 tLogRow 来显示反规范化数据的结果。为此,添加 tLogRow,并在 i 的组件选项卡中,选择 Table (在表格单元格中打印值) 选项。让我们运行 Talend tDenormalize 作业并查看结果。

Run the Talend tDenormalize Job to Workflow to Normalize the Data

让我们将此 tDenormalize 输出保存到文本文件中,该文件包含标题以及用“‘”分隔的列。接下来,运行 Talend tDenormalize 作业。

Configure the Talend tDenormalize Output to Workflow to Normalize the Data

接下来,打开 NormData 文本文件向您展示结果。

Result Text