Apache Spark - Quiz


Question 1:Which of the following Java statement would be most appropriate to load the data (sfpd.txt) into an RDD? Assume that SparkContext is available as the variable “sc”.
Login to view solution
Question 2:

Given the following lines of code in Java, identify at which step the input RDD is actually computed.
JavaRDD<String> inputRDD = sc.textFile(“user/user/01/data/salesdat.csv”);
JavaRDD<String> elecRD = inputRDD.map(line=>line.split(“,”));
JavaRDD<String> elecRDD = inputRDD.filter(line=>line.contains(“ELECTRONICS”));
long elecCount = elecRDD.count();

Login to view solution
Question 3:Which of the following is true of actions computed on RDDs?
Login to view solution
Question 4:When you are reusing an RDD a number of times, it is advisable to:
Login to view solution
Question 5:Which of the following operations in Java would help you to see a few lines of the data in the DataFrame named as “exampleDF” ?
Login to view solution

Share Quiz

Comments

Comments
comments powered by Disqus

Navigation

Social Media