[编辑:这个答案现在已经过时了,已经有一个row_number
函数添加到查询语言中。如果有人遇到类似于此答案的奇怪查询,则此答案将用于历史目的]
Not easily.
如果可以使用 /events ODATA 查询路径而不是 /query 路径,则支持分页。但不是像您那样真正的自定义查询。
要获得诸如分页之类的功能,您需要进行复杂的查询,并使用summarize
and makeList
并发明了一个rowNum
查询中的字段,然后使用mvexpand
重新展开列表,然后按rowNum
。它非常复杂且不直观,例如:
customEvents
| project customDimensions.FilePath, timestamp
| where timestamp > now(-100d)
| order by timestamp desc
// squishes things down to 1 row where each column is huge list of values
| summarize filePath=makelist(customDimensions.FilePath, 1000000)
, timestamp=makelist(timestamp, 1000000)
// make up a row number, not sure this part is correct
, rowNum = range(1,count(strcat(filePath,timestamp)),1)
// expands the single rows into real rows
| mvexpand filePath,timestamp,rowNum limit 1000000
| where rowNum > 0 and rowNum <= 100 // you'd change these values to page
我相信 appinsights uservoice 已经请求支持查询语言中的分页运算符。
这里的另一个假设是数据没有改变当您工作时在底层表中。如果出现新数据在您的通话之间, like
- 给我 0-99 行
- 出现 50 个新行
- 给我第 100-199 行
那么第 3 步是actually返回您在步骤 1 中刚刚获得的 50 个重复行。