I have a list with more than 30 strings. how to convert list into dataframe .
what i tried:
eg
Val list=List("a","b","v","b").toDS().toDF()
Output :
+-------+
| value|
+-------+
|a |
|b |
|v |
|b |
+-------+
Expected Output is
+---+---+---+---+
| _1| _2| _3| _4|
+---+---+---+---+
| a| b| v| a|
+---+---+---+---+
any help on this .
解决方案
List("a","b","c","d") represents a record with one field and so the resultset displays one element in each row.
To get the expected output, the row should have four fields/elements in it. So, we wrap around the list as List(("a&