|-- x: array (nullable = true)
| |-- element: struct (containsNull = true)
| | |-- y: struct (nullable = true)
| | |-- z: struct (nullable = true)
| | | |-- aa: string (nullable = true)
I have the above nested schema where I want to change column z from struct to string.
|-- x: array (nullable = true)
| |-- element: struct (containsNull = true)
| | |-- y: struct (nullable = true)
| | |-- z: string (nullable = true)
I'm not using Spark 3 but Spark 2.4.x. Will prefer Scala way but python works too since this is a one time manual thing to backfill some past data.
Is there a way to do this with some udf or any other way?
I know it's easy to do this via to_json but the nested array of struct is causing issues.