Array remove(数组移除(Array remove))¶
Supported in: Batch, Faster, Streaming
Returns an array after removing all provided 'value' from the given array.
Expression categories: Array
Declared arguments¶
- Array: Array from which to remove provided 'value'.
Expression\> - Value: Value to be removed from array.
Expression\
Type variable bounds: T accepts AnyType
Output type: Array\
Examples¶
Example 1: Base case¶
Argument values:
- Array: [ 1, 2, 3 ]
- Value: 1
Output: [ 2, 3 ]
Example 2: Base case¶
Description: Remove all instances of the value.
Argument values:
- Array: [ 1, 2, 2 ]
- Value: 2
Output: [ 1 ]
Example 3: Base case¶
Description: Return the whole array if the value is not found.
Argument values:
- Array: [ 1, 2, 3 ]
- Value: 10
Output: [ 1, 2, 3 ]
Example 4: Null case¶
Argument values:
- Array:
array - Value:
value
| array | value | Output |
|---|---|---|
| [ 1, 2, null, 3 ] | null | [ 1, 2, 3 ] |
| [ 1, 2, 3 ] | null | [ 1, 2, 3 ] |
| null | 1 | null |
| null | null | null |
中文翻译¶
数组移除(Array remove)¶
支持:批处理(Batch)、快速处理(Faster)、流处理(Streaming)
从给定数组中移除所有指定的"值(value)"后,返回处理后的数组。
表达式类别: 数组(Array)
声明参数¶
- 数组(Array): 需要从中移除指定"值"的数组。
表达式\> - 值(Value): 需要从数组中移除的值。
表达式\
类型变量约束: T 接受任意类型(AnyType)
输出类型: Array\
示例¶
示例1:基础案例¶
参数值:
- 数组(Array): [ 1, 2, 3 ]
- 值(Value): 1
输出: [ 2, 3 ]
示例2:基础案例¶
说明: 移除该值的所有实例。
参数值:
- 数组(Array): [ 1, 2, 2 ]
- 值(Value): 2
输出: [ 1 ]
示例3:基础案例¶
说明: 如果未找到该值,则返回整个数组。
参数值:
- 数组(Array): [ 1, 2, 3 ]
- 值(Value): 10
输出: [ 1, 2, 3 ]
示例4:空值案例¶
参数值:
- 数组(Array):
array - 值(Value):
value
| array | value | 输出(Output) |
|---|---|---|
| [ 1, 2, null, 3 ] | null | [ 1, 2, 3 ] |
| [ 1, 2, 3 ] | null | [ 1, 2, 3 ] |
| null | 1 | null |
| null | null | null |