我是 pyspark 的新手。我试图了解如何访问具有多层嵌套结构和数组的镶木地板文件。我需要用 null 替换数据帧(具有嵌套模式)中的某些值,我已经看到这个解决方案它可以很好地处理结构,但不确定它如何处理数组。
我的架构是这样的
|-- unitOfMeasure: struct
| |-- raw: struct
| | |-- id: string
| | |-- codingSystemId: string
| | |-- display: string
| |-- standard: struct
| | |-- id: string
| | |-- codingSystemId: string
|-- Id: string
|-- actions: array
| |-- element: struct
| | |-- action: string
| | |-- actionDate: string
| | |-- actor: struct
| | | |-- actorId: string
| | | |-- aliases: …Run Code Online (Sandbox Code Playgroud)