Azure数据工厂:处理以前的日期数据

时间:2017-04-03 17:38:54

标签: azure azure-data-factory

我一直在尝试找到一种动态设置管道的startend属性的方法。这样做的原因是在管道执行的当天之前5天处理一系列文件。

我尝试在管道JSON中设置它:

"start": "Date.AddDays(SliceStart, -5)"
"start": "Date.AddDays(SliceEnd, -5)"

当通过VS2015发布时,我收到以下错误:

Unable to convert 'Date.AddDays(SliceEnd, -5)' to a DateTime value. 
Please use ISO8601 DateTime format such as \"2014-10-01T13:00:00Z\" 
for UTC time, or \"2014-10-01T05:00:00-8:00\" for Pacific Standard 
Time. If the timezone designator is omitted, the system will consider 
it denotes UTC time by default. Hence, \"2014-10-01\" will be 
converted to \"2014-10-01T00:00:00Z\" automatically..
","code":"InputIsMalformedDetailed"

其他可能的方法是什么?

1 个答案:

答案 0 :(得分:0)

而不是试图动态地在管道级别设置它,这不会起作用。在针对数据集和活动配置时间片时,您需要处理它。

在数据集的可用性块中使用名为偏移的JSON属性,并在活动的调度程序块中使用。

这将使用由间隔和频率配置的时间片起始值,并以天/小时/分钟等方式将其偏移给定值。

例如(在数据集中):

// etc....
},
"availability": {
  "frequency": "Day",
  "interval": 1,
  "style": "StartOfInterval",
  "offset": "-5.00:00:00" //minus 5 days
}
//etc....

您需要在两个位置配置此项,否则活动将在部署时失败验证。

查看此Microsoft文章,了解有关可用于配置更复杂时间片方案的所有属性的详细信息。

https://docs.microsoft.com/en-us/azure/data-factory/data-factory-create-pipelines

希望这有帮助。