0

我正在尝试使用 Kusto 中的表格并将用户定义的函数应用于各个列。在下面的查询中:我从 JSON 类型的表中获取两列,并比较它们是否相等。

let MyFilter = (X:(x:dynamic, y:dynamic)) {
    X |  where isnotempty(tostring(x[0].key)) and isnotempty(tostring(y[0].key)) and x[0].key == y[0].key ;
};
tabl
| where MyFilter(ObjJson,ObjJson1) == true

但是,此代码似乎不起作用。有人可以帮忙吗?

4

1 回答 1

1

尝试使用invoke运算符:https ://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/invokeoperator

let MyFilter = (X:(x:dynamic, y:dynamic)) {
    X
    | where isnotempty(tostring(x[0].key)) and 
            isnotempty(tostring(y[0].key)) and 
            tostring(x[0].key) == tostring(y[0].key)
};
table
| invoke MyFilter()
于 2021-10-14T20:55:11.643 回答