我有一個數據幀火花斯卡拉 - 合併多發性行成一個
|--id:string (nullable = true)
|--ddd:struct (nullable = true)
|-- aaa: string (nullable = true)
|-- bbb: long(nullable = true)
|-- ccc: string (nullable = true)
|-- eee: long(nullable = true)
我有這樣的
id | ddd
--------------------------
1 | [hi,1,this,2]
2 | [hello,6,good,3]
1 | [hru,2,where,7]
3 | [in,4,you,1]
2 | [how,4,to,3]
我想預期的O/P輸出:
id | ddd
--------------------
1 | [hi,1,this,2],[hru,2,where,7]
2 | [hello,6,good,3],[how,4,to,3]
3 | [in,4,you,1]
請幫忙
是,即使可能嗎?因爲您只是更改列* dddd *的結構,所以它成爲一個結構數組,並且聚合 – tricky
正常。可以給我的代碼請 – gayathri