https://blog.knoldus.com/spark-createdataframe-vs-todf/
Spark: createDataFrame() vs toDF()