ARRAY_UNION
Description
The ARRAY_UNION function is used to compute the union of two arrays, i.e., it merges all elements from array1 and array2 and removes duplicates. This function can handle arrays containing any data type, including integers, floats, strings, etc.
Parameter Description
array1
:array<T>
type, representing the first input array.array2
:array<T>
type, representing the second input array.
Return Result
Returns a new array containing all unique elements from array1 and array2.
Usage Example
- Compute the union of two integer arrays:
- Find the union of two string arrays:
- Find the union of two arrays of floating-point numbers:
Notes
- If the input array is empty, the ARRAY_UNION function will return an empty array.