简体   繁体   English

从 Azure 数据资源管理器中删除转义字符

[英]Remove escape characters from Azure Data Explorer JSON object in Azure Data Factory

I trying to export the results of an ADX query into a JSON file using ADF.我尝试使用 ADF 将 ADX 查询的结果导出到 JSON 文件中。 I have tried using the copy activity to map the data directly from the query to the blob storage dataset.我已经尝试使用复制活动来 map 将数据直接从查询到 blob 存储数据集。 Two of the columns that are being returned are 'dynamic' type in ADX, and such should be output as a JSON object in the file.在 ADX 中返回的两个列是“动态”类型,在文件中应该是 output 作为 JSON object。

The input for the query looks as required, with no additional characters:查询的输入看起来像要求的那样,没有额外的字符:

输入数据集定义

数据预览

The below image is the top of the properties column (column 5), showing the opening of the object bracket.下图是属性列(第 5 列)的顶部,显示了 object 支架的开口。

属性对象列

The output file only contains additional escape and line return characters within the properties object data that is returned. output 文件仅在返回的属性 object 数据中包含其他转义和换行符。 The Build, TypeName and other key and value pair columns are not affected. Build、TypeName 和其他键值对列不受影响。

修改后的输出列

I need to be able to return this data in JSON format without any of the additional characters.我需要能够在没有任何附加字符的情况下以 JSON 格式返回此数据。 Any ideas on how I could achieve this within ADF?关于如何在 ADF 中实现这一目标的任何想法?

You can use as below query:您可以使用如下查询:

SETEL_Objects | project ID, FullName, parse_json(properties) | take 50

Refer official MS docs for more details: todynamic(), parse_json()有关详细信息,请参阅官方 MS 文档: todynamic()、parse_json()

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

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