我的管道有两个测试活动。一个查找活动和一个存储过程,它只接受查找的输出,然后将其用作参数来执行。
我想在我正在编写的查询中获取字段的最大值(comos-db-unix时间戳)。
这是我对来源的查询:
select max(c._ts) AS UnixTimestamp from c
where udf.convertTime(c._ts) >= '@{formatDateTime(addhours(pipeline().TriggerTime, -1), 'yyyy-MM-ddTHH:mm:ssZ' )}'
AND udf.convertTime(c._ts) < '@{formatDateTime(pipeline().TriggerTime, 'yyyy-MM-ddTHH:mm:ssZ' )}'
调试时,这是转换后的输入:
{
"source": {
"type": "DocumentDbCollectionSource",
"query": "select max(c._ts) AS UnixTimestamp from c \nwhere udf.convertTime(c._ts) >= '2018-11-06T18:19:56Z' \nAND udf.convertTime(c._ts) < '2018-11-06T19:19:56Z'",
"nestingSeparator": "."
},
"dataset": {
"referenceName": "SourceComosDB",
"type": "DatasetReference",
"parameters": {}
},
"firstRowOnly": false
}
查找活动的输出结果是:
{
"count": 18,
"value": [
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{}
],
"effectiveIntegrationRuntime": "DefaultIntegrationRuntime (East US 2)"
}
因此不执行存储过程。
如何获取查询中的最大值?