我如何使用這個答案(List to DataFrame in pyspark a new answer to create a table using spark for nested list?lst = [{'sfObject': 'event', 'objID': 'Id', 'interimRun': 'True', 'numAttributes_Total': 140, 'numAttributes_Compounded': 0, 'numAttributes_nonCompounded': 140, 'chunks': 1, 'compoundStatus': 'False', 'allAttributes': ['Id', 'RecordTypeId', 'WhoId', 'Advisor_Team__c’,…], 'compoundAttributes': [], 'nonCompoundAttributes': ['Id', 'RecordTypeId', 'WhoId', 'WhatId’…]}, {'sfObject': 'fund__c', 'objID': 'Id', 'interimRun': 'False', 'numAttributes_Total': 40, 'numAttributes_Compounded': 0, 'numAttributes_nonCompounded': 40, 'chunks': 1, 'compoundStatus': 'False', 'allAttributes': ['Id', 'IsDeleted', 'Name’…], 'compoundAttributes': [], 'nonCompoundAttributes': ['Id', 'IsDeleted', 'Name', 'RecordTypeId’…]}] 我想創建將這個列表存儲到一個表中,所以需要它的結構是這樣的:下面的鏈接是我需要使用上面的 lst 創建的表的圖像:在此處輸入圖像描述此嵌套列表最多包含 30 個不同的項目,因此答案需要為每個項目動態創建最多 30 行。謝謝!
如何使用嵌套列表創建 Spark 表
慕婉清6462132
2023-01-04 15:28:26