Get started
Load & manage data
Work with data
Administration
Reference & resources
CLUSTER BY
mask
ROW FILTER
Updated Dec 04, 2024
Send us feedback
forall
Applies to: Databricks SQL Databricks Runtime
Tests whether func holds for all elements in the array.
func
forall(expr, func)
expr: An ARRAY expression.
expr
func: A lambda function returning a BOOLEAN.
A BOOLEAN.
The lambda function uses one parameter passing an element of the array.
> SELECT forall(array(1, 2, 3), x -> x % 2 == 0); false > SELECT forall(array(2, 4, 8), x -> x % 2 == 0); true > SELECT forall(array(1, NULL, 3), x -> x % 2 == 0); false > SELECT forall(array(2, NULL, 8), x -> x % 2 == 0); NULL
filter function
exists function