Get started
Load & manage data
Work with data
Administration
Reference & resources
Updated Sep 29, 2023
Send us feedback
array_compact
Applies to: Databricks Runtime 12.2 and later
Removes NULL elements from array.
array
array_compact(array)
array: An ARRAY expression.
The function returns an array of the same type as the input argument where all NULL values have been removed.
> SELECT array_compact(array(1, 2, NULL, 3, NULL, 3)); [1,2,3] > SELECT array_compact(array(NULL, NULL)); []
array_append function
array_distinct function
array_except function
array_intersect function
array_prepend function
array_sort function
array_remove function
array_union function