我在我们的域中有一个查询,我无法让它工作。我使用数据表来模仿我的问题。我正在尝试在用户定义的函数中使用投影值。
// this works
let f = (a:int) {
datatable (b:string, d:int) ["2015-12-31", 1, "2016-12-30", 2, "2014-01-05", 3]
| as dataset
| where d == a
| project b;
};
datatable (d:int) [1, 2, 3]
| as dataset
| project toscalar(f(2))
// this doesnt work, why is the 'd' not used (projected) in function q.
// if I add toscalar to the project it also doesnt work
let f = (a:int) {
datatable (b:string, d:int) ["2015-12-31", 1, "2016-12-30", 2, "2014-01-05", 3]
| as dataset
| where d == a
| project b;
};
datatable (d:int) [1, 2, 3]
| as dataset
| project toscalar(f(d))
我在这里错过了什么,我期待'| project' 对每个结果使用函数 (f)。
这里有 2 个要修改的查询。
谢谢