How to change schema in PySpark from this
|-- id: string (nullable = true)
|-- device: array (nullable = true)
| |-- element: struct (containsNull = true)
| | |-- device_vendor: string (nullable = true)
| | |-- device_name: string (nullable = true)
| | |-- device_manufacturer: string (nullable = true)
to this
|-- id: string (nullable = true)
|-- device_vendor: string (nullable = true)
|-- device_name: string (nullable = true)
|-- device_manufacturer: string (nullable = true)