I work with Spark 2.0 Scala. I can convert RDD to DataFrame using toDF () method.
val rdd = sc.textFile("/pathtologfile/logfile.txt") val df = rdd.toDF()
But for life, I cannot find where this is in the API docs. This is not under RDD. But it is under the DataSet ( link 1 ). However, I have an RDD, not a DataSet.
Also, I cannot see this under implications ( ref. 2 ).
So please help me understand why toDF () can be called for my RDD. Where does this method inherit from?
This comes from here:
API Spark 2
: sqlContext.implicits._, RDD DataSetHolder (rddToDataSetHolder), toDF DataSetHolder
sqlContext.implicits._
RDD
DataSetHolder
rddToDataSetHolder
toDF
, , , . , , - . case, List, , , , DF. , , Spark 2.1.1 toDF, . , , , .read. 5 .
, .
import spark.sqlContext.implicits._ val df = <mutable list object>.toDF df.show()
, sqlContext implicits :
val sqlContext = //create sqlContext import sqlContext.implicits._ val df = RDD.toDF()
"toDF" RDD
.
Source: https://habr.com/ru/post/1651365/More articles:Create UTF8 file without specification using Inno Setup (Unicode version) - utf-8Inno Setup Changing a text file and changing a specific line - inno-setupInno installation compiler: how to modify file contents - inno-setupReplace the placeholder in the installed text file with the user entered by the user - inno-setupHow to get the value of multiple files in an array without a loop statement - javascriptInno Setup - How to edit a specific line from a text file during installation? - inno-setupIon tag does not display all text in Ionic2 - angularInno Setup: how to start the code procedure in the Run or Run section? - inno-setupjavascript: how to abort $ .post () - javascriptCollapse and cross data frames - rAll Articles