简体   繁体   English

如何在 Azure 数据工厂管道中直接转换 JSON 文件数据

[英]How to transform JSON file data directly in a Azure Data Factory pipeline

I want to copy a JSON file into Azure SQL table, but it has nested Hierarchy, I only need the fields/values of the fields Ergon_Businessunit_code, KPL, Ergon_Functiegroep_code, Aantal.我想将 JSON 文件复制到 Azure SQL 表中,但它具有嵌套层次结构,我只需要字段 Ergon_Businessunit_code、KPL、Ergon_Functiegroep_code、Aantal 的字段/值。 How to do that?怎么做? I tried with lookup en foreach, but got array errors我尝试使用 lookup en foreach,但出现数组错误

在此处输入图像描述

Yes as Mark Kromer mentioned, you can copy JSON data to the Azure SQL table using the dataflow activity.是的,正如 Mark Kromer 提到的,您可以使用dataflow活动将 JSON 数据复制到 Azure SQL 表。

Here are the steps to copy JSON to Azure SQL using dataflow:以下是使用数据流将JSON复制到Azure SQL的步骤:

  1. Create a JSON dataset and connect it to the source.创建一个JSON数据集并将其连接到源。

在此处输入图像描述

  1. Source data preview:数据预览:

在此处输入图像描述

  1. Connect the source output to flatten transformation and under Unroll by and Unroll root, select " rows " array.连接源 output 以flatten转换,并在 Unroll by 和 Unroll root 下,select“”数组。

  2. You can remove the columns which not required to pass to the sink.您可以删除不需要传递给接收器的列。

在此处输入图像描述

  1. Data preview after it is flattened.展平后的数据预览

在此处输入图像描述

  1. Add sink transformation and connect to Azure SQL table dataset.添加接收转换并连接到 Azure SQL 表数据集。

在此处输入图像描述

  1. In mapping , add or remove mapping as per the output columns.mapping中,根据 output 列添加或删除映射。

在此处输入图像描述

  1. Output data of sink. Output接收器数据。

在此处输入图像描述

  1. Add the dataflow activity to the pipeline and execute it.dataflow活动添加到管道并执行它。

在此处输入图像描述

  1. Data loaded to Azure SQL table .数据加载到Azure SQL 表

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM