在 Microsoft Fabric 中将示例数据复制到湖屋,然后使用数据工厂数据流对其进行转换

在本教程中,我们提供了一个常见方案的端到端步骤,即使用管道以高性能副本将源数据加载到湖屋中,然后通过数据流转换数据,使用户可以轻松加载和转换数据。

先决条件

已启用 Microsoft Fabric 的工作区。 如果还没有工作区,请参阅创建工作区一文。

创建数据管道

  1. 切换到数据工厂体验。

    Screenshot showing the selection of the Data Factory experience.

  2. 选择“新建”,然后选择“数据管道”,再输入管道的名称。

    Screenshot showing the new Data pipeline button.

    Screenshot showing the pipeline name dialog.

使用管道将示例数据加载到湖屋

按照以下步骤将示例数据加载到湖屋。

步骤 1:从复制助手开始

选择画布上的“复制数据”,打开“复制助手”工具以开始使用。

Screenshot showing the Copy data button on a new pipeline.

步骤 2:配置源

  1. 从数据源的“示例数据”选项中选择“公共节假日”,然后选择“下一步”。

    Screenshot showing the Public Holidays sample data selection in the Copy data assistant.

  2. 复制数据助手的“连接到数据源”部分中,将显示示例数据的预览。 选择“下一步”转到数据目标。

    Screenshot showing a preview of the Public Holiday sample data.

步骤 3:配置目标

  1. 选择“工作区”选项卡,然后选择“湖屋”。 然后,选择“下一步”。

    Screenshot showing the selection of the Lakehouse destination.

  2. 选择“新建湖屋”,输入 LHDemo 作为名称,然后选择“下一步”。

    Screenshot showing the Create new lakehouse option with the name LHDemo specified for the new Lakehouse.

  3. 通过输入表名称来配置源数据并将其映射到目标湖屋表,然后再选择“下一步”。

    Screenshot showing the table name to create in the Lakehouse destination.

步骤 4:查看和创建复制活动

  1. 在前面的步骤中查看复制活动设置,然后选择“立即开始数据传输”。 然后选择“保存 + 运行”以运行新管道。

    Screenshot showing the Review + save window of the copy data assistant with the Start data transfer immediately checkbox checked.

  2. 完成后,复制活动将添加到新的数据管道画布,管道会自动运行以将数据加载到湖屋中。

    Screenshot showing the created pipeline with Copy activity and the current run in progress.

  3. 可以监视正在运行的进程,并在管道画布下方的“输出”选项卡上检查结果。 将鼠标悬停在输出行中的名称上,可以看到“运行详细信息”按钮(一副眼镜的图标,突出显示),用于查看运行详细信息。

    Screenshot showing the run details button on the pipeline Output tab.

  4. 运行详细信息显示读取和写入了 69,557 行,以及有关运行的其他各种详细信息,包括持续时间明细。

    Screenshot showing the run details for the successful pipeline run.

使用数据流 gen2 转换湖屋中的数据

现在,你有一个加载了示例数据的湖屋。 接下来,你将使用数据流来转换数据。 数据流是大规模转换数据的一种无代码方式。

  1. 选择“新建”,然后选择“数据流 Gen2”。

    Screenshot showing the new Dataflow button.

  2. 单击“获取数据”下拉列表,然后选择“更多...”。

    Screenshot showing the get data dropdown.

  3. 搜索湖屋并选择“Microsoft Fabric 中的湖屋”。

    Screenshot showing the Lakehouse in Microsoft Fabric option.

  4. 登录并单击“下一步”继续。

    Screenshot showing the sign-in dialog.

  5. 选择在上一步中创建的表,然后单击“创建”。

    Screenshot showing the selection of the table created in the previous step.

  6. 在编辑器中查看数据预览。

    Screenshot showing the data preview in the dataflow editor.

  7. 对数据流应用筛选器,以便仅包含 Countryorregion 列等于 Belgium 的行。

    Screenshot showing the filter applied to the dataflow.

  8. 选择“添加数据目标”,然后选择“Microsoft Fabric 中的湖屋”,将数据目标添加到查询中。

    Screenshot showing the add data destination button.

  9. 登录并单击“下一步”继续。

    Screenshot showing the sign-in dialog.

  10. 创建名为 BelgiumPublicHolidays 的新表,然后单击“下一步”。

    Screenshot showing the create new table dialog.

  11. 检查设置,然后单击“保存设置”。

    Screenshot showing the review settings dialog.

  12. 单击“发布”发布数据流。

    Screenshot showing the publish button.

  13. 发布数据流后,单击“立即刷新”以运行数据流。

    Screenshot showing the refresh now button.

刷新完成后,可以在湖屋表中查看数据。 现在还可以使用此数据来创建报表、仪表板等。

此示例演示如何在 Microsoft Fabric 中使用数据工厂将示例数据复制到湖屋并使用数据流转换数据。 你已了解如何执行以下操作:

  • 创建数据管道。
  • 使用管道将示例数据加载到湖屋。
  • 使用数据流转换湖屋中的数据。

接下来,请继续了解有关监视管道运行的详细信息。