1
我有JSON數據等:爆炸陣列<陣列<string>>的數據幀從JSON階創建
{
"resultid": "Success",
"userId": "abc",
"cardtype": "ag",
"computescore": [{
"values": ["654", "655", "666"]
}, {
"values": ["754", "755", "777"]
}]
}
scala> val a = input.select("computescore.values")
a: org.apache.spark.sql.DataFrame = [values: array<array<string>>]
scala> a.collect.foreach(println)
[WrappedArray(WrappedArray(654, 655, 666), WrappedArray(754, 755, 777))]
我想從這個實現的是數據幀具有多個行和例如多列
a1 a2 a3
654 655 666
754 755 777