繁体   English   中英

尝试在 azure 数据工厂中复制数据时如何处理空的 Rest 调用?

[英]How do you handle an empty Rest call when trying to copy data in azure data factory?

我有一个复制数据活动,其中我的源数据集设置为 RestResource。 它工作正常,除了偶尔 Rest 调用返回一个空数据集: {"d":{"results":[]}}

这会导致以下错误

{
    "errorCode": "2200",
    "message": "ErrorCode=UserErrorTypeInSchemaTableNotSupported,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Failed to get the type from schema table. This could be caused by missing Sql Server System CLR Types.,Source=Microsoft.DataTransfer.ClientLibrary,''Type=System.InvalidCastException,Message=Unable to cast object of type 'System.DBNull' to type 'System.Type'.,Source=Microsoft.DataTransfer.ClientLibrary,'",
    "failureType": "UserError",
    "target": "Import Punch Adjustments",
    "details": []
}

我知道对于其他来源,您可能想要查找或检查元数据然后执行条件 if,但我不确定如何为 rest 来源执行此操作。 还有其他更好的选择吗?

您可以在失败时添加一个活动,这样即使复制活动失败管道也会成功运行。

例子:

我添加了一个活动来存储失败时的错误代码。

@string(activity('Copy data1').Error.errorCode)

在此处输入图像描述

在此处输入图像描述

流水线状态:

在此处输入图像描述

暂无
暂无

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

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