如何在 Azure 数据工厂中展平 JSON 数据?

How to flatten JSON data in Azure Data Factory?

我有来自 SQL 数据库的源,其中数据存储为 JSON。请参见下图,其中记录列包含 JSON.

记录列包含 JSON 如下数据。我正在尝试展平 JSON 列,以便 JSON 中的每个项目都假定为表格形式。是否可以在 Azure 数据工厂中执行此操作?

{
   "resourceType":"Encounter",
   "id":"9i5W6tp-JTd-24252",
   "meta":{
      "versionId":"1591978948308",
      "lastUpdated":"2020-06-12T16:22:28.308Z"
   },
   "status":"finished",
   "class":{
      "system":"http://terminology.hl7.org/CodeSystem/v3-ActCode",
      "code":"AMB"
   },
   "type":[
      {
         "coding":[
            {
               "system":"http://snomed.info/sct",
               "code":"185345009",
               "display":"Encounter for symptom"
            }
         ],
         "text":"Encounter for symptom"
      }
   ],
   "subject":{
      "reference":"Patient/9i5W6tp-JTd-24249",
      "display":"Mrs. tonia30 back373"
   },
   "participant":[
      {
         "individual":{
            "reference":"Practitioner/9i5W6tp-JTd-24251",
            "display":"Dr. Stevie682"
         }
      }
   ],
   "period":{
      "start":"1962-05-27T08:26:51Z",
      "end":"1962-06-10T08:26:51Z"
   },
   "reasonCode":[
      {
         "coding":[
            {
               "system":"http://snomed.info/sct",
               "code":"232353008",
               "display":"Perennial allergic rhinitis with seasonal variation"
            }
         ]
      }
   ],
   "serviceProvider":{
      "reference":"Organization/9i5W6tp-JTd-24250",
      "display":"HOSPITAL"
   }
}

我同意@Mark Kromer 的观点。今天,我们无法展平嵌入在 ADF 数据流列中的 JSON 文档。暂时不可能。

建议:

  1. 将 SQL table 数据作为 JSON 格式文件复制到接收器。
  2. 然后使用导出的JSON格式文件作为源,将JSON数组展平得到表格形式。

这就是问题的解决方法。我们希望数据工厂产品团队能够取得进展并尽快更新我们。等待好消息,再次感谢Mark

我目前正在使用 ADF 数据流可以变平 JSON。