In my application I have a need to create a single-row DataFrame from a Map.
So that a Map like
("col1" -> 5, "col2" -> 10, "col3" -> 6) would be transformed into a DataFrame with a single row and the map keys would become names of columns.
col1 | col2 | col3 5 | 10 | 6 In case you are wondering why would I want this - I just need to save a single document with some statistics into MongoDB using MongoSpark connector which allows saving DFs and RDDs.