Ich habe dieses Schema und ich möchte das Innere des Ergebnisses in Spalten aufteilen, um col1 zu haben: EventCode, col2: Nachricht, etc ... Ich benutze Pyspark, Ich habe versucht, die explode-Funktion, aber es scheint nicht auf structType zu arbeiten, gibt es eine Möglichkeit, dies in Spark tun?Zeilen von Datenrahmen zu einfachen Zeilen in Pyspark teilen
root
|-- result: struct (nullable = true)
| |-- EventCode: string (nullable = true)
| |-- Message: string (nullable = true)
| |-- _bkt: string (nullable = true)
| |-- _cd: string (nullable = true)
| |-- _indextime: string (nullable = true)
| |-- _pre_msg: string (nullable = true)
| |-- _raw: string (nullable = true)
| |-- _serial: string (nullable = true)
| |-- _si: array (nullable = true)
| | |-- element: string (containsNull = true)
| |-- _sourcetype: string (nullable = true)
| |-- _time: string (nullable = true)
| |-- host: string (nullable = true)
| |-- index: string (nullable = true)
| |-- linecount: string (nullable = true)
| |-- source: string (nullable = true)
| |-- sourcetype: string (nullable = true)