我的 ADF 管道中有一个步骤失败并出现以下错误:
Operation on target LastRun failed: The expression 'formatDateTime(activity('Last Run').output.firstRow.lastdate, 'yyyy-MM-dd HH:mm:ss')' cannot be evaluated because property 'firstRow' doesn't exist, available properties are 'effectiveIntegrationRuntime, durationInQueue'.
有趣的是,如果我重新运行管道,它就会按预期工作。有谁知道为什么这可能第一次失败,但之后又工作了?
出现此错误的位是查找后的“设置变量”:
查找是雪花数据库的简单 SQL 脚本:
select max(PROCESSINGCOMPLETE) as lastdate from schema.loadcontrol where status = 'Completed' and filedirection = 'Inbound'
而设置的变量只是为了将日期转换成更好的格式:
@formatDateTime(activity('Last Run').output.firstRow.lastdate, 'yyyy-MM-dd HH:mm:ss')
错误消息表明,firstrow 不是有效选项,但它存在于查询生成器中:
十次有九次有效,但第十次我不知道为什么它不喜欢它。有人以前遇到过这个吗?
first row
属性。当查找活动中未选中 first row only
选项或查找活动未返回任何值时,可能会发生这种情况。选项:1
First row only
复选框。选中仅第一行复选框后查找活动的输出 Json。
{
"firstRow": {
"lastdate": "2000-01-01"
},
"effectiveIntegrationRuntime": "xxxx",
"billingReference": {
XXXXX
},
"durationInQueue": {
XXX
}
}
选项:2 - 即使在查找活动中检查
first row only option
后,如果您收到错误,则当查找活动没有返回数据时,可能会发生这种情况。
然后更改逻辑以在查找活动中没有值时获取一些默认值。