数据工厂 DataSet 中上次修改过滤器的动态格式化

Dynamic formatting of last modified filter in Data factory DataSet

我正在尝试在 Azure 数据工厂数据集中动态设置最后修改的过滤器。

我正在使用以下表达式:

@formatDateTime(adddays(utcnow(),-2),'yyyy-mm-ddThh:mm:ss.fffZ')

我收到以下错误:

Activity Copy1 failed: Failure happened on 'Source' side. ErrorCode=UserErrorInvalidValueInPayload,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Failed to convert the value in 'modifiedDatetimeStart' property to 'System.Nullable`1[[System.DateTime, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]' type. Please make sure the payload structure and value are correct.,Source=Microsoft.DataTransfer.DataContracts,''Type=System.Reflection.TargetInvocationException,Message=Exception has been thrown by the target of an invocation.,Source=mscorlib,''Type=System.FormatException,Message=The DateTime represented by the string is not supported in calendar System.Globalization.GregorianCalendar.,Source=mscorlib,'

我也无法使用此过滤器预览数据。我想这里出了点问题。有什么想法吗?

从错误消息中我了解到日历不支持日期的字符串表示。

The DateTime represented by the string is not supported in calendar 

为什么需要格式化字符串进行比较?

或许,作为一种解决方法,您可以使用此表达式来删除日期时间表达式中的额外字符:

@substring(formatDateTime(adddays(utcnow(),-2), 'o'), 0, 23)

我用 utcnow() 测试了它,它应该 return 所需格式的日期时间:

"value": "2019-04-12T10:11:51.108Z"

实际上,以下命令在发布和触发后已经过测试和工作:

@utcnow()

@adddays(utcnow(),-2)

是前端的预览功能无法处理表情。希望微软能解决这个问题。

原来你可以解决上面的问题,将字符串转换为上面的行,所以从

@formatDateTime(adddays(utcnow(),-2),'yyyy-mm-ddThh:mm:ss.fffZ')

改为

@string(formatDateTime(adddays(utcnow(),-2),'yyyy-mm-ddThh:mm:ss.fffZ'))

它对我有效

在数据流中遇到同样的问题:

currentUTC()

无法提取 blob 存储中最后修改的文件,但是

currentTimestamp()

做过