简体   繁体   English

如何在并行源的数据流 adf 中记录错误

[英]How to log errors in dataflow adf of parallel sources

I have to do some data engineering by reading manifest.cdm.json files from datalake.我必须通过从 datalake 读取manifest.cdm.json文件来做一些数据工程。 add pipeline run id column and push to sql database.添加管道运行 id 列并推送到 sql 数据库。

I have one json list file which have required parameter to read CDM json file in source of dataflow.我有一个json list file ,它具有读取数据流源中的CDM json file所需的参数。

Previous Approach : I used Foreach and passed parameter to dataflow with single activity then error capturing.以前的方法:我使用Foreach并将参数传递给具有single activitydataflow ,然后捕获错误。 But use of Dataflow with for each costs too much..但是使用 Dataflow with for each成本太高了..

Current Approch : I mannually created Dataflow with all cdm files.当前方法:我手动创建了包含所有 cdm 文件的数据流。 But here I'm not able to capture error.但是在这里我无法捕获错误。 If any source got error all dataflow activity fails.如果任何源出错,所有数据流活动都会失败。 and If I select skip error in dataflow activity I'm not getting any error.如果我在数据流活动中选择跳过错误,我不会收到任何错误。

So what should be the approch to get errors from current approch.那么从当前方法中获取错误的方法应该是什么。

天蓝色数据流

You can capture the error using set variable activity in Azure Data Factory.可以使用 Azure 数据工厂中的set variable活动来捕获错误。

Use below expression to capture the error message using Set Variable activity:使用以下表达式使用 Set Variable 活动捕获错误消息:

@activity('Data Flow1').Error.message

在此处输入图像描述

Later you can store the error message in blob storage for future reference using copy activity .稍后您可以使用copy activity将错误消息存储在 Blob 存储中以供将来参考。 In below example we are saving error message in .csv file using DelimitedText dataset.在下面的示例中,我们使用 DelimitedText 数据集将错误消息保存在 .csv 文件中。

在此处输入图像描述

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

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