'where' in apache spark
<pre><code>df:

-----------+
|       word|
+-----------+
|       1609|
|           |
|        the|
|    sonnets|
|           |
|         by|
|    william|
|shakespeare|
|           |
|         fg|
</code></pre>

<p>This is my data frame. How to remove the empty rows (to remove the rows that contain '') using the 'where' clause. </p>

<pre><code>code:

df.where(trim(df.word) == "").show()

output:

----+
|word|
+----+
|    |
|    |
|    |
|    |
|    |
|    |
|    |
|    |
|    |
</code></pre>

<p>Any help is appreciated.</p>