title: Error while exploding a struct column in Spark
body: <p>I have a dataframe whose schema looks like this:</p>
  
  <pre><code>event: struct (nullable = true)
  |    | event_category: string (nullable = true)
  |    | event_name: string (nullable = true)
  |    | properties: struct (nullable = true)
  |    |    | ErrorCode: string (nullable = true)
  |    |    | ErrorDescription: string (nullable = true)
  </code></pre>
  
  <p>I am trying to explode the <code>struct</code> column <code>properties</code> using the following code: </p>
  
  <pre><code>df_json.withColumn("event_properties", explode($"event.properties"))
  </code></pre>
  
  <p>But it is throwing the following exception: </p>
  
  <blockquote>
  <pre><code>cannot resolve 'explode(`event`.`properties`)' due to data type mismatch: 
  input to function explode should be array or map type, 
  not StructType(StructField(IDFA,StringType,true),
  </code></pre>
  </blockquote>
  
  <p>How to explode the column <code>properties</code>?</p>