我有以下2个DataFrame架构。内部USER_INFO
modules
是一个数组,content
是一个嵌套在modules
内的数组。我想加入/附加一些其他数据(METADATA
)到每个content
元素,以便
USER_INFO.modules.content.id = METADATA.cust_id
什么是解决方案?
USER_INFO
root
|-- userId: string (nullable = true)
|-- modules: array (nullable = true)
| |-- element: struct (containsNull = true)
| | |-- content: array (nullable = true)
| | | |-- element: struct (containsNull = true)
| | | | |-- distance: double (nullable = true)
| | | | |-- id: string (nullable = true)
| | | | |-- impressionId: string (nullable = true)
| | |-- id: string (nullable = true)
METADATA
root
|-- cust_id: string (nullable = true)
|-- image_url: string (nullable = true)