set_intersect()set_intersect()

返回一个 dynamic 数组,其中包含在所有数组 (arr1 ∩ arr2 ∩ ...) 中的所有非重复值的集合。Returns a dynamic array of the set of all distinct values that are in all arrays - (arr1 ∩ arr2 ∩ ...).

语法Syntax

set_intersect(arr1, arr2[, *arr3*, ...])set_intersect(arr1, arr2[, *arr3*, ...])

参数Arguments

  • arr1...arrN:用于创建交集的输入数组(至少两个数组)。arr1...arrN: Input arrays to create an intersect set (at least two arrays). 所有参数都必须是动态数组。All arguments must be dynamic arrays. 有关详细信息,请参阅 pack_arrayFor more information, see pack_array.

返回Returns

返回一个动态数组,其中包含在所有数组中的所有非重复值的集合。Returns a dynamic array of the set of all distinct values that are in all arrays. 请参阅 set_union()set_difference()See set_union() and set_difference().

示例Example

range x from 1 to 3 step 1
| extend y = x * 2
| extend z = y * 2
| extend w = z * 2
| extend a1 = pack_array(x,y,x,z), a2 = pack_array(x, y), a3 = pack_array(w,x)
| project set_intersect(a1, a2, a3)
Column1Column1
 [1][1]
[2][2]
[3][3]
print arr = set_intersect(dynamic([1, 2, 3]), dynamic([4,5]))
arrarr
[][]