title: Count empty values in dataframe column in Spark (Scala)
body: <p>I'm trying to count empty values in column in DataFrame like this:</p>
  <pre><code>df.filter((df(colname) === null) || (df(colname) === &quot;&quot;)).count()
  </code></pre>
  <p>In <code>colname</code> there is a name of the column. This works fine if column type is string but if column type is integer and there are some nulls this code always returns 0. Why is this so? How to change it to make it work?</p>