I have a DataFrame column containing a list with some empty values:
df.select('foo').show(10)
+----------+
|foo |
+----------+
|[,] |
|[bar, baz]|
|[,bar] |
+----------+
I would like to filter out all empty values, i.e. it should look like that:
+----------+
|foo |
+----------+
|null |
|[bar, baz]|
|[bar] |
+----------+
I tried using array_remove, but I cannot exclude the empty string.