

 Amazon Redshift will no longer support the use of Python UDFs after June 30, 2026. We will start enforcing it in phases. For more information on the details of Python end of life and migration options, 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/) that was published on June 30, 2025. 

# default\_array\_search\_null\_handling
<a name="r_default_array_search_null_handling"></a>

## Values (default in bold)
<a name="default_array_search_null_handling-values"></a>

**TRUE**, FALSE

## Description
<a name="description"></a>

Specifies the null handling behavior for array search operations. When `default_array_search_null_handling` is `TRUE`, NULL values are treated as valid elements that can be searched within arrays. When `default_array_search_null_handling` is `FALSE`, NULL key searches return NULL, and if the array contains NULL values with no match found, the search returns NULL.

## Examples
<a name="default_array_search_null_handling-example"></a>

```
SET default_array_search_null_handling to TRUE;

-- ARRAY_CONTAINS: NULL search is allowed
SELECT ARRAY_CONTAINS(ARRAY('red', NULL, 'green'), NULL);
array_contains
----------------
 t
(1 row)

-- ARRAY_POSITION: Array can contain NULLs
SELECT ARRAY_POSITION(ARRAY('red', NULL, 'green'), 'blue');
 array_position 
----------------
             -1
(1 row)
```

```
SET default_array_search_null_handling to FALSE;

-- ARRAY_CONTAINS: NULL search is disabled
SELECT ARRAY_CONTAINS(ARRAY('red', 'green'), NULL);
array_contains
----------------
 
(1 row)

-- ARRAY_POSITION: Array contains NULL but no match is found
SELECT ARRAY_POSITION(ARRAY('red', NULL, 'green'), 'blue');
 array_position 
----------------
               
(1 row)
```