I have a Map[String, Dataframe]. I want to combine all the data inside that Map into a single Dataframe. Can a dataframe have a column of Map datatype?
def sample(dfs : Map[String,Dataframe]): Dataframe =
{
.........
}
Example:
DF1
id name age
1 aaa 23
2 bbb 34
DF2
game time score
ludo 10 20
rummy 30 40
I pass the above two DFs as Map to the function. Then put data of the each dataframes into a single column of the output dataframe as json format.
out DF
+---------------------------------------------------------------------------------------+
| column1 |
+---------------------------------------------------------------------------------------+
| [{"id":"1","name":"aaa","age":"23"},{"id":21","name":"bbb","age":"24"}] |
| [{"game":"ludo","time":"10","score":"20"},{"game":"rummy","time":"30","score":"40"}] |
+---------------------------------------------------------------------------------------+