Lưu ý
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử đăng nhập hoặc thay đổi thư mục.
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử thay đổi thư mục.
Applies to:
Databricks SQL
Databricks Runtime 12.2 LTS and above
Removes NULL elements from array.
Syntax
array_compact(array)
Arguments
array: An ARRAY expression.
Returns
The function returns an array of the same type as the input argument where all NULL values have been removed.
Examples
> SELECT array_compact(array(1, 2, NULL, 3, NULL, 3));
[1, 2, 3, 3]
> SELECT array_compact(array(NULL, NULL));
[]