

 Amazon Redshift will no longer support the creation of new Python UDFs starting Patch 198. Existing Python UDFs will continue to function until June 30, 2026. For more information, see the [ blog post ](https://aws.amazon.com/blogs/big-data/amazon-redshift-python-user-defined-functions-will-reach-end-of-support-after-june-30-2026/). 

# ARRAY\$1DISTINCT function
<a name="array_distinct"></a>

Creates a new array containing only unique elements from the input array, removing all duplicates. The order of elements in the output array is not guaranteed to match the input order. NULL values are treated as valid elements; if multiple NULLs exist in the input array, only one NULL appears in the output.

## Syntax
<a name="array_distinct-syntax"></a>

```
ARRAY_DISTINCT( array )
```

## Arguments
<a name="array_distinct-arguments"></a>

 *array*   
A SUPER expression that specifies the array.

## Return type
<a name="array_distinct-return-type"></a>

The ARRAY\$1DISTINCT function returns a SUPER type.

## Example
<a name="array_distinct-example"></a>

The following examples show the ARRAY\$1DISTINCT function.

```
SELECT ARRAY_DISTINCT(ARRAY(1, 1, 'a', 'a', NULL, NULL));
 array_distinct 
----------------
 [1,"a",null]
(1 row)

SELECT ARRAY_DISTINCT(ARRAY_CONCAT(ARRAY(1,2,3,3),ARRAY(2,3,4,4)));
 array_distinct 
----------------
 [1,2,3,4]
(1 row)
```

## See also
<a name="array_distinct-see-also"></a>
+ [ARRAY\$1UNION function](array_union.md)
+ [ARRAY\$1SORT function](array_sort.md)
+ [ARRAY\$1EXCEPT function](array_except.md)
+ [ARRAY\$1INTERSECTION function](array_intersection.md)