我有一个包含多列的Parquet文件,其中有两列是JSON/Struct类型,但它们的类型是字符串。可能存在任意数量的array_elements。
{
"addressline": [
{
"array_element": "F748DK’8U1P9’2ZLKXE"
},
{
"array_element": "’O’P0BQ04M-"
},
{
"array_element": "’fvrvrWEM-"
}
],
"telephone": [
{
"array_element": {
"locationtype": "8.PLT",
"countrycode": null,
"phonenumber": "000000000",
"phonetechtype": "1.PTT",
"countryaccesscode": null,
"phoneremark": null
}
}
]
}
我该如何在PySpark中创建模式以处理这些列?