Details
-
Sub-task
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
Description
Removes duplicate values from the array.
Syntax:
array_distinct(array)
Arguments:
array: An ARRAY to be handled.
Returns:
An ARRAY. If value is NULL, the result is NULL. Keeps order of elements.
Examples:
SELECT array_distinct(ARRAY[1, 2, 3, 2, 1]); -- [1, 2, 3] SELECT array_distinct(ARRAY[1, NULL, 1]); -- [1, NULL]
See also
https://spark.apache.org/docs/latest/api/sql/index.html#array_distinct
Attachments
Issue Links
- links to