What does the following code print

0 votes
What does the following code print?

val airports= sc.parallelize (Array(1L, ("SFO")), (2L, ("ORD")),(3L,("DFW"))))

val routes = sc.parallelize

(Array(edge(1L,2L,1800),Edge(2L,3L,800),Edge(3L,1L,1400)))

val nowhere ="nowhere"

valraph = Graph(airports,routes,nowhere)

graph.vertices.collect.foreach(printLn)

Option a) (2,ORD)

                (1,SFO)

                (3,DFW)

Option b)Edge(1,2,1800)

               Edge(2,3,800)

               Edge(3,1,1400)

Option c)(1,2,1800)

               (2,3,800)

               (3,1,1400)

Option d)Run time error
Nov 24, 2020 in Apache Spark by ritu
• 980 points
61 views

1 answer to this question.

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

Option D

answered Nov 25, 2020 by Gitika
• 65,870 points

Related Questions In Apache Spark

0 votes
0 answers

What does the below code print?

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

Nov 24, 2020 in Apache Spark by ritu
• 980 points

closed Nov 25, 2020 by Gitika 394 views
0 votes
0 answers

What is the output of the following code?

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

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

closed Nov 25, 2020 by MD 40 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,870 points
60 views
0 votes
1 answer

What does the command df.registerTempTable() do?

df.registerTempTable(“airports”) This command is used to register ...READ MORE

answered Jul 14, 2019 in Apache Spark by James
4,145 views
0 votes
1 answer

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

Hi, @Ritu, List(5,100,10) is printed. The take method returns the first n elements in ...READ MORE

answered Nov 23, 2020 in Apache Spark by Gitika
• 65,870 points
66 views
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,060 points
56 views
0 votes
1 answer

From the following graph code ,which code snippet will return the no.of flight routes?

Hey, @Ritu, I am getting error in your ...READ MORE

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

What will be printed when the below code is executed ?

Option a) List(5,100,10) The take method returns the first n elements in an ...READ MORE

answered Nov 26, 2020 in Apache Spark by Gitika
• 65,870 points
56 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,870 points
52 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,870 points
55 views