I\'m working through a Databricks example. The schema for the dataframe looks like:
> parquetDF.printSchema root |-- department: struct (nullable = true) |
In my opinion the most elegant solution is to star expand a Struct using a select operator as shown below:
var explodedDf2 = explodedDf.select("department.*","*")
https://docs.databricks.com/spark/latest/spark-sql/complex-types.html