title: Exploded Struct in Spark
body: <p>I have DataFrame with following schema:</p>
  
  <pre><code> |-- data: struct (nullable = true)
   |    |-- asin: string (nullable = true)
   |    |-- customerId: long (nullable = true)
   |    |-- eventTime: long (nullable = true)
   |    |-- marketplaceId: long (nullable = true)
   |    |-- rating: long (nullable = true)
   |    |-- region: string (nullable = true)
   |    |-- type: string (nullable = true)
   |-- uploadedDate: long (nullable = true)
  </code></pre>
  
  <p>I want to explode the struct such that all elements like asin, customerId, eventTime become the columns in DataFrame. I tried explode function but it works on Array not on struct type. Is it possible to convert the able data frame to below dataframe:</p>
  
  <pre><code>     |-- asin: string (nullable = true)
       |-- customerId: long (nullable = true)
       |-- eventTime: long (nullable = true)
       |-- marketplaceId: long (nullable = true)
       |-- rating: long (nullable = true)
       |-- region: string (nullable = true)
       |-- type: string (nullable = true)
       |-- uploadedDate: long (nullable = true)
  </code></pre>