代码之家  ›  专栏  ›  技术社区  ›  MAK

基于参数的Azure数据工厂管道运行

  •  0
  • MAK  · 技术社区  · 7 年前

    我正在使用ADF将数据从Cosmos数据库复制到Azure数据湖。我计划每24小时运行一次。由于ADF将所有数据从源复制到接收器,因此我使用windowStart和windowEnd参数来过滤数据。过滤是在Cosmos文档数据库中的时间戳上完成的。

    要运行管道,我必须手动指定windowStart和windowEnd UTC时间,这是不可行的。有没有办法实现自动化?我想要的是将windowStart时间设置为(计划时间-1天),windowEnd时间设置为计划时间。这样我就可以得到前一天的所有数据。

    生成的查询是:

    select * from c 
    where c.data.timestamp >= '@{formatDateTime(pipeline().parameters.windowStart, 'yyyy-MM-ddTHH:mm:ssZ' )}' 
    AND c.data.timestamp < '@{formatDateTime(pipeline().parameters.windowEnd, 'yyyy-MM-ddTHH:mm:ssZ' )}'
    

    如何将windowStart和windowEnd动态设置为等于计划时间的-1天?

    1 回复  |  直到 7 年前
        1
  •  0
  •   Fang Liu    7 年前

    如果您正在使用 schedule trigger ,将以下值传递到管道中。使用 adddays 您可以使用ADF UI来帮助您编辑/新建触发器。 enter image description here

    "name": "trigger1",
    "properties": {
        "runtimeState": "Stopped",
        "pipelines": [
            {
                "pipelineReference": {
                    "referenceName": "CopyPipeline_9ca",
                    "type": "PipelineReference"
                },
                "parameters": {
                    "windowStart": "@adddays(trigger().scheduledTime, -1)",
                    "windowEnd": "@trigger().scheduledTime"
                }
            }
        ],
    
    推荐文章