Apache Spark Basics

34 / 89

Which of the following is not a way of creating RDD using Scala?


Note - Having trouble with the assessment engine? Follow the steps listed here


No hints are availble for this assesment

Answer is not availble for this assesment

Please login to comment

5 Comments

var myrdd = Array(1,2,3,4)
This command has created rdd in scala ,so how is this the correct option?

  Upvote    Share

Hi, Vaibhav.

var myrdd = Array(1,2,3,4)
Will create just an array in scala donn't get confused with the name myrdd. To create an rdd you need to a SparkContext- "sc" object to make it an rdd.
All the best!

-- Satyajit Das

  Upvote    Share

Thank you sir, now i get that !

  Upvote    Share

can you explain why this line is the answer?
var myrdd = Array(1,2,3,4)
I am able to run it and can run command myrdd.take(2)

  Upvote    Share

Hi David Lee,

We have "take" method in Array collection also, so myrdd.take(2) will return first two elements in the array. It is not related to RDD

  Upvote    Share