title: na.fill in Spark DataFrame Scala
body: <p>I am using Spark/Scala and I want to fill the nulls in my DataFrame with default values based on the type of the columns.</p>
  
  <p>i.e String Columns -> "string", Numeric Columns -> 111, Boolean Columns -> False etc.</p>
  
  <p>Currently the DF.na.functions API provides na.fill<br>
  <code>fill(valueMap: Map[String, Any])</code> like </p>
  
  <pre><code>df.na.fill(Map(
      "A" -&gt; "unknown",
      "B" -&gt; 1.0
  ))
  </code></pre>
  
  <p>This requires knowing the column names and also the type of the columns.</p>
  
  <p>OR</p>
  
  <pre><code>fill(value: String, cols: Seq[String])
  </code></pre>
  
  <p>This is only String/Double types, not even Boolean.</p>
  
  <p>Is there a smart way to do this?</p>