title: How to add new field to struct column?
body: <p>I have a dataframe with something like this <code>df.printSchema</code>:</p>
  <pre class="lang-none prettyprint-override"><code>root
  |-- ts: timestamp (nullable = true)
  |-- geoip: struct (nullable = true)
  |    |-- city: string (nullable = true)
  |    |-- continent: string (nullable = true)
  |    |-- location: struct (nullable = true)
  |    |    |-- lat: float (nullable = true)
  |    |    |-- lon: float (nullable = true)
  </code></pre>
  <p>I know that for example with <code>df = df.withColumn(&quot;error&quot;, lit(null).cast(StringType))</code> I can add a <code>null</code> field called <code>error</code> of type <code>string</code> right under the <code>root</code>. How could I add the same field under the <code>geoip</code> struct, or under the <code>location</code> struct?</p>
  <p>I have also tried <code>df = df.withColumn(&quot;geoip.error&quot;, lit(null).cast(StringType))</code> with no luck.</p>