Arrays have intersection(数组存在交集(Arrays have intersection))¶
Supported in: Batch, Faster, Streaming
Checks if given arrays have at least one shared element.
Expression categories: Array, Boolean
Declared arguments¶
- Expressions: List of arrays to check.
List\>>
Type variable bounds: T accepts AnyType
Output type: Boolean
Examples¶
Example 1: Base case¶
Argument values:
- Expressions: [[ 1, 2, 3 ], [ 3, 4 ]]
Output: true
Example 2: Base case¶
Argument values:
- Expressions: [[ 1, 2 ], [ 3, 4 ]]
Output: false
Example 3: Base case¶
Argument values:
- Expressions: [[ 1, 2, 3 ], [ 3, 4 ], [ 2, 3 ]]
Output: true
Example 4: Null case¶
Argument values:
- Expressions: [
first_array,second_array]
| first_array | second_array | Output |
|---|---|---|
| [ 1, 2, 3 ] | null | false |
| null | null | false |
中文翻译¶
数组存在交集(Arrays have intersection)¶
支持:批处理(Batch)、快速计算(Faster)、流处理(Streaming)
检查给定数组是否至少包含一个共同元素。
表达式类别: 数组(Array)、布尔(Boolean)
声明的参数¶
- 表达式(Expressions): 待检查的数组列表。
List\>>
类型变量约束: T 接受任意类型(AnyType)
输出类型: 布尔(Boolean)
示例¶
示例 1:基础情况¶
参数值:
- 表达式: [[ 1, 2, 3 ], [ 3, 4 ]]
输出: true
示例 2:基础情况¶
参数值:
- 表达式: [[ 1, 2 ], [ 3, 4 ]]
输出: false
示例 3:基础情况¶
参数值:
- 表达式: [[ 1, 2, 3 ], [ 3, 4 ], [ 2, 3 ]]
输出: true
示例 4:空值情况¶
参数值:
- 表达式: [
first_array,second_array]
| first_array | second_array | 输出(Output) |
|---|---|---|
| [ 1, 2, 3 ] | null | false |
| null | null | false |