【发布时间】:2019-04-03 06:48:11
【问题描述】:
let a = (arg0:long) {
toscalar(
Incidents
| where IncidentId == arg0
| count)
};
range idx from 0 to 11 step 1
| extend a(idx)
我的kusto查询字符串就是这样,通俗易懂,但是不行。
【问题讨论】:
let a = (arg0:long) {
toscalar(
Incidents
| where IncidentId == arg0
| count)
};
range idx from 0 to 11 step 1
| extend a(idx)
我的kusto查询字符串就是这样,通俗易懂,但是不行。
【问题讨论】:
您遇到了用户定义函数的限制,如下所示: https://docs.microsoft.com/en-us/azure/kusto/query/functions/user-defined-functions#restrictions-on-the-use-of-user-defined-functions
您应该能够通过执行以下操作来实现您的目标(与您提供的示例相匹配):
let count_by_incident_id =
Incidents
| summarize count() by IncidentId
;
range idx from 0 to 11 step 1
| join hint.strategy = broadcast (count_by_incident_id)
on $left.idx == $right.IncidentId
【讨论】: