+1 vote
in Spark Preliminaries by
Which of the following Scala statement would be most appropriate to load the data (sfpd.txt) into an RDD? Assume that SparkContext is available as the variable “sc” and SQLContext as the variable “sqlContext.”

val sfpd=sc.loadFile(“/path to file/sfpd.txt”)

val sfpd=sc.loadText(“/path to file/sfpd.txt”)

val sfpd=sc.textFile(“/path to file/sfpd.txt”)

val sfpd=sqlContext.loadText(“/path to file/sfpd.txt”)

1 Answer

0 votes
by

val sfpd=sc.textFile(“/path to file/sfpd.txt”)

...