Spark 2.0 Scala - RDD.toDF()
<p>I am working with Spark 2.0 Scala. I am able to convert an RDD to a DataFrame using the toDF() method. </p>

<pre><code>val rdd = sc.textFile("/pathtologfile/logfile.txt")
val df = rdd.toDF()
</code></pre>

<p>But for the life of me I cannot find where this is in the API docs. It is not under RDD. But it is under DataSet (<a href="http://spark.apache.org/docs/latest/api/scala/index.html#org.apache.spark.sql.Dataset@toDF():org.apache.spark.sql.DataFrame" rel="noreferrer">link 1</a>). However I have an RDD not a DataSet.</p>

<p>Also I can't see it under implicits (<a href="http://spark.apache.org/docs/latest/api/scala/index.html#org.apache.spark.sql.SQLContext" rel="noreferrer">link 2</a>).</p>

<p>So please help me understand why toDF() can be called for my RDD. Where is this method being inherited from?</p>