如何为昨天的记录指定对Azure数据工厂源(Azure表存储)的查询 [英] How to specify query for Azure Data Factory Source (Azure Table Storage) for yesterday's records

查看:75
本文介绍了如何为昨天的记录指定对Azure数据工厂源(Azure表存储)的查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我每天都将记录从Azure存储表(源)复制到Azure存储表(接收器).因此,例如,如果我在2019年12月24日(UTC)执行查询,那么我想复制2019年12月23日(UTC)的记录.该查询工作,并且正在做我打算做的事情.这是查询:

I am copying records from an Azure Storage Table (source) to Azure Storage Table (sink) everyday. So if I am executing the query on December 24th 2019 (UTC) for instance, then I want to copy records for December 23rd 2019 (UTC). The query works and is doing what I intend it to do. Here is the query:

Timestamp ge datetime'2019-12-23T00:00Z' and Timestamp lt datetime'2019-12-24T00:00Z'

在上面的查询中,当在其中插入新记录时,时间戳"列会自动标记在Azure存储表中.这就是Azure存储表的工作方式.

In the query above, the Timestamp column is automatically stamped in the Azure Storage Table when a new record is inserted in it. That is how Azure Storage Table works.

这是数据工厂管道的屏幕截图:

And here is the screenshot of the Data Factory Pipeline:

我现在想参数化查询.也就是说:如果查询在2019年12月24日运行,则它应复制2019年12月23日的记录并在每天按计划执行时保持滑动.我不知道该怎么做.我知道这里有一个utcNow函数,还有一个减去自时间函数.我只是不知道如何把它放在一起.

I want to parameterize the query now. That is: if the query is run on 24th December, 2019 then it should copy 23rd December 2019's records and keep sliding as it executes everyday on a schedule. I don't know how to do that. I know that there is a utcNow function and there is a subtractFromTime Function. I just don't know how to put it together.

推荐答案

您可以执行以下操作:

addDays(startOfDay(utcNow()), -1)

这将找到前一天的开始

https ://docs.microsoft.com/zh-CN/azure/data-factory/control-flow-expression-language-functions#date-functions

这篇关于如何为昨天的记录指定对Azure数据工厂源(Azure表存储)的查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆