https://stackoverflow.com/questions/61863489/flatten-nested-json-in-scala-spark-dataframe
(comment https://stackoverflow.com/a/61863579/3251389)
https://stackoverflow.com/questions/37471346/automatically-and-elegantly-flatten-dataframe-in-spark-sql - flatten only schema examples
Get flattened schema
scala> df.printSchema
root
|-- author: string (nullable = true)
|-- frameworks: array (nullable = true)
| |-- element: struct (containsNull = true)
| | |-- id: long (nullable = true)
| | |-- name: string (nullable = true)
|-- id: long (nullable = true)
|-- name: string (nullable = true)
scala> df.explodeColumns.printSchema
root
|-- author: string (nullable = true)
|-- frameworks_id: long (nullable = true)
|-- frameworks_name: string (nullable = true)
|-- id: long (nullable = true)
|-- name: string (nullable = true)
scala>Intermediate result Pattern matching on struct types. Final result Adding recursive Schema snakify without calling df.select recursively and syntax ingestion