2 What will be printed when the below code is executed

0 votes
2)What will be printed when the below code is executed ?

val numRDD = sc.parallelize(List(5,100,10,150,78,0))

val num = numRdd.take(3)

println(num.toList)

a)List(5,100,10)

b)List(0,78,150)

c)List(0,5,10)

d)Run time error
Nov 23, 2020 in Apache Spark by ritu
• 960 points
1,399 views

1 answer to this question.

0 votes

Hi, @Ritu,

List(5,100,10) is printed.

The take method returns the first n elements in an RDD.

answered Nov 23, 2020 by Gitika
• 65,730 points

Related Questions In Apache Spark

–1 vote
0 answers
0 votes
1 answer

From the below code. what is the most appropriate next step in ML process?

Hi@ritu, The most appropriate step according to me ...READ MORE

answered Nov 25, 2020 in Apache Spark by MD
• 95,460 points
1,922 views
0 votes
1 answer

What does the below code print?

Option d) Run time error. READ MORE

answered Nov 25, 2020 in Apache Spark by Gitika
• 65,730 points
1,965 views
0 votes
0 answers

What does the below code print?

What does the below code print? val AgeDs ...READ MORE

Nov 25, 2020 in Apache Spark by ritu
• 960 points

closed Nov 25, 2020 by Gitika 1,640 views
0 votes
1 answer

What is the output of the following code?

After executing your code, there is an ...READ MORE

answered Nov 25, 2020 in Apache Spark by Gitika
• 65,730 points
1,715 views
0 votes
1 answer

13)Refer the input and identify the output if the below code is run

Option c)  Run time error - A READ MORE

answered Nov 25, 2020 in Apache Spark by Gitika
• 65,730 points
1,701 views
0 votes
0 answers

What is the output of the following code?

What is the output of the following ...READ MORE

Nov 25, 2020 in Apache Spark by Edureka
• 200 points

closed Nov 26, 2020 by MD 1,240 views
0 votes
1 answer

What is the output of the following code?

rror: expected class or object definition sc.parallelize(Array(1L,("SFO")),(2L,("ORD")),(3L,("DFW")))) ^ one error ...READ MORE

answered Nov 26, 2020 in Apache Spark by Gitika
• 65,730 points
1,625 views
0 votes
1 answer

What will be printed when the below code is executed ?

List 5 100 10 READ MORE

answered Feb 7, 2023 in Apache Spark by Subbu

edited Mar 5, 2025 3,030 views
0 votes
1 answer

What will be printed when the below code is executed?

Option a) 443 READ MORE

answered Mar 8, 2023 in Apache Spark by anonymous

edited Mar 5, 2025 3,975 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP