我在数据集中有一个Map字段,其模式如下
|-- party: map (nullable = true)
| |-- key: string
| |-- value: struct (valueContainsNull = true)
| | |-- partyName: string (nullable = true)
| | |-- cdrId: string (nullable = true)
| | |-- legalEntityId: string (nullable = true)
| | |-- customPartyId: string (nullable = true)
| | |-- partyIdScheme: string (nullable = true)
| | |-- customPartyIdScheme: string (nullable = true)
| | |-- bdrId: string (nullable = true)
需要将其转换为json类型。请建议怎么做。提前谢谢
1条答案
按热度按时间siv3szwd1#
spark提供了一个可用于Dataframe操作的json函数: