Kusto如果Array包含数组则不返回结果



我想编写一个kusto查询,如果变量中存在三条记录,则基本上不返回任何结果。下面是一个例子:

let someValues = datatable (name: string)
[
"111",
"222",
"333",
];
// my query

因此,如果someValues变量包含所有三个字符串- "111", "222", "333"那么我的查询应该不返回任何结果。如果只包含其中的2个"111", "222"那么它应该只返回false。如果包含其中一个"222"那么它也应该返回false。但是如果它包含所有三个字符串"111", "222", "333"那么查询应该不会返回任何结果。

这是我的尝试,但它不工作。

let someValues = datatable (name: string)
[
"111",
"222",
"333",
];
someValues
| summarize make_set(name)
| where set_name contains "111" and set_name contains "222" and set_name contains "333" // this doesn't work because it outputs 1 row

这里是一个等价的c#程序。

static void Main(string[] args)
{
List<string> s = new List<string>() {"111", "222", "333"};
if (s.Contains("111") && s.Contains("222") && s.Contains("333"))
return; // no results
else
{
Console.WriteLine("False"); // prints false
}
}
let someValues = datatable (name: string)
[
"111",
"222",
"333"
];
let values = dynamic(["111", "222", "333"]);
someValues
| summarize make_set(name)
| project   diff_is_empty_set = array_length(set_difference(values, set_name)) == 0
| where     not(diff_is_empty_set)

小提琴

最新更新