ich einen Funken Datenrahmen haben, die wie folgt aussieht:Datenrahmen Transformationen mit verschachtelten Strukturen
root
|-- employeeName: string (nullable = true)
|-- employeeId: string (nullable = true)
|-- employeeEmail: string (nullable = true)
|-- company: struct (nullable = true)
| |-- companyName: string (nullable = true)
| |-- companyId: string (nullable = true)
| |-- details: struct (nullable = true)
| | |-- founded: string (nullable = true)
| | |-- address: string (nullable = true)
| | |-- industry: string (nullable = true)
Was will ich tun Gruppe von CompanyID und eine Reihe von Mitarbeitern pro Unternehmen erhalten, wie folgt aus:
root
|-- company: struct (nullable = true)
| |-- companyName: string (nullable = true)
| |-- companyId: string (nullable = true)
| |-- details: struct (nullable = true)
| | |-- founded: string (nullable = true)
| | |-- address: string (nullable = true)
| | |-- industry: string (nullable = true)
|-- employees: array (nullable = true)
| |-- employee: struct (nullable = true)
| | |-- employeeName: string (nullable = true)
| | |-- employeeId: string (nullable = true)
| | |-- employeeEmail: string (nullable = true)
Natürlich kann ich das leicht tun, wenn ich nur ein Paar (Firma, Mitarbeiter) hatte: (String, String) mit map und reduceByKey. Aber mit all den verschiedenen verschachtelten Informationen bin ich mir nicht sicher, welchen Ansatz ich wählen soll.
Sollte ich versuchen, alles zu glätten? Jedes Beispiel, um ähnliche Dinge zu tun, wäre sehr hilfreich.
Danke, ich habe es geschafft, es auf ähnliche Weise zu lösen. – Dmitri