+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”)

Related questions

+1 vote
asked Sep 16, 2022 in Spark Preliminaries by sharadyadav1986
0 votes
asked Sep 16, 2022 in Spark Preliminaries by sharadyadav1986
...