HadoopExam Blogs

HadoopExam Learning Resources

Question 5: Which of the following is a correct way to create an RDD, assume sc is an instance of SparkContext (API syntax are given not correct)

A. sc.textFile("Path to a text file")

B. sc.sequenceFile()

C. sc.hadoopRDD()

D. sc.hadoopFile()

E. sc.loadSequenceFile()

1. A,B,C

2. B,C,D

3. C,D,E

4. A,D,E

5. A,C,E

Correct Answer: 1 Exp: Apache Spark API supports various file format to be loaded as an RDD. For example

textFile() : It reads the file and will return an RDD that contains one record per line

wholeTextFile() : it helps you to read a directory containing multiple small text files and returns an RDD as (Key, FileContent). Filename as a key and

its content as a value

sequenceFile() : For reading sequence file

hadoopRDD() : to read hadoop format files

Oreilly Databricks Spark Certification     Hortonworks HDPCD Spark Certification     Cloudera CCA175 Hadoop and Spark Developer Certifications    MCSD : MapR Certified Spark Developer  

  1. Apache Spark Professional Training with Hands On Lab Sessions 
  2. Oreilly Databricks Apache Spark Developer Certification Simulator
  3. Hortonworks Spark Developer Certification 
  4. Cloudera CCA175 Hadoop and Spark Developer Certification 

Watch below Training Video

You are here: Home MapR Certification MapR:Spark MapR Spark Certification Sample Question-5