title: How do I add a column to a nested struct in a PySpark dataframe?
body: <p>I have a dataframe with a schema like</p>
  <pre class="lang-none prettyprint-override"><code>root
   |-- state: struct (nullable = true)
   |    |-- fld: integer (nullable = true)
  </code></pre>
  <p>I'd like to add columns within the <code>state</code> struct, that is, create a dataframe with a schema like</p>
  <pre class="lang-none prettyprint-override"><code>root
   |-- state: struct (nullable = true)
   |    |-- fld: integer (nullable = true)
   |    |-- a: integer (nullable = true)
  </code></pre>
  <p>I tried</p>
  <pre class="lang-py prettyprint-override"><code>df.withColumn('state.a', val).printSchema()
  # root
  #  |-- state: struct (nullable = true)
  #  |    |-- fld: integer (nullable = true)
  #  |-- state.a: integer (nullable = true)
  </code></pre>