Apache Spark Basics

20 / 69
Apache Spark - Which of the following is scala code thats reads data...

Which of the following is scala code thats reads data from HDFS file using spark-shell?

  • val mydata = sparkContext.textFile("/data/mr/wordcount/input/")
  • val mydata = HDFS.textFile("/data/mr/wordcount/input/")
  • var mydata = sc.textFile("/data/mr/wordcount/input/")
  • mydata = sc.textFile("/data/mr/wordcount/input/")
  • None, It is not possible using spark-shell