Spark 2.4 introduced new useful Spark SQL functions involving arrays but I was a little bit puzzled when I find out that the result of:
select array_remove(array(1, 2, 3, null, 3), null) is null and not [1, 2, 3, 3].
Is this an expected behavior? Is it possible to remove nulls using array_remove?
As a side note, for now the alternative I am using is a higher order function in databricks:
select filter(array(1, 2, 3, null, 3), x -> x is not null)