---
title: arrays_overlap function
description: Learn the syntax of the arrays\_overlap function of the SQL language in Databricks SQL and Databricks Runtime.
canonical_url: https://docs.databricks.com/aws/en/sql/language-manual/functions/arrays_overlap
---

# `arrays_overlap` function

**Applies to:** ![check marked yes](https://docs.databricks.com/aws/en/images/icons/check.png) Databricks SQL ![check marked yes](https://docs.databricks.com/aws/en/images/icons/check.png) Databricks Runtime

Returns true if the intersection of `array1` and `array2` is not empty.

## Syntax

```
arrays_overlap (array1, array2)
```

## Arguments

* `array1`: An ARRAY.
* `array2`: An ARRAY sharing a least common type with `array1`.

## Returns

In Databricks SQL, the result is the least common type of `array1` and `array2`.
In Databricks Runtime, the result is BOOLEAN `true` if there is overlap.

If the arrays have no common non-null element, they are both non-empty, and either of them contains a null element, `NULL`, `false` otherwise.

## Examples

```sql
> SELECT arrays_overlap(array(1, 2, 3), array(3, 4, 5));
 true
> SELECT arrays_overlap(array(1, 2, NULL, 3), array(NULL, 4, 5));
 NULL
```

## Related

* [`array_contains` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/array_contains.md)
* [`array_position` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/array_position.md)
* [SQL data type rules](https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-datatype-rules.md)
