I want to create a DF of text files where each row represents a whole txt file in a column named text.
I've tried the following but I got a DF where the text is separated by lines.
Dataset<Row> df = spark.read()
.textFile("resources/textfile.txt")
.toDF("text");
Instead of DF of 1 row in the case of 1 file, I've got a DF of 70 rows for this file.