0
我有下面的JSON結構,我試圖將每個元素轉換爲列,如下所示使用Spark SQL進行結構化。爆炸(控制)不起作用。有人可以建議一種方法來做到這一點?Spark SQL爆炸結構數組
輸入:
{
"control" : [
{
"controlIndex": 0,
"customerValue": 100.0,
"guid": "abcd",
"defaultValue": 50.0,
"type": "discrete"
},
{
"controlIndex": 1,
"customerValue": 50.0,
"guid": "pqrs",
"defaultValue": 50.0,
"type": "discrete"
}
]
}
所需的輸出:
controlIndex customerValue guid defaultValult type
0 100.0 abcd 50.0 discrete
1 50.0 pqrs 50.0 discrete
你能添加代碼你試過了嗎? – mrsrinivas
我試過 - 從myview中選擇爆炸(控制)它使一列,並把每個結構內, – abiswas