9 In scala which one of the following will give the top 10 resolutions to the console assuming that sfpdDF is the DataFrame registered as a table - sfpd

0 votes
9)In scala, which one of the following will give the top 10 resolutions to the console, assuming that sfpdDF is the DataFrame registered as a table - sfpd?

a. sqlContext.sql("SELECT resolution, count(incidentnum) AS cnt FROM sfpd GROUP BY resolution ORDER BY inccount DESC limit 10")

b. sfpdDF.select("resolution".count.sort($"count".desc).show(10)

c. sfpdDF.groupBy("partition").count.unsort($"count".desc).show(20)

d. sfpdDF.select("parquet").count.sort(S"count".desc).show(10)
Nov 23, 2020 in Apache Spark by ritu
• 960 points
2,984 views

1 answer to this question.

0 votes
Hey, @Ritu,

According to the question, the answer should be option a) sqlContext.sql("SELECT resolution, count(incidentnum) AS cnt FROM sfpd GROUP BY resolution ORDER BY inccount DESC limit 10")
answered Nov 23, 2020 by Gitika
• 65,770 points

Related Questions In Apache Spark

0 votes
1 answer

The number of stages in a job is equal to the number of RDDs in DAG. however, under one of the cgiven conditions, the scheduler can truncate the lineage. identify it.

Hi@Edureka, Spark's internal scheduler may truncate the lineage of the RDD graph ...READ MORE

answered Nov 26, 2020 in Apache Spark by MD
• 95,460 points
4,010 views
0 votes
0 answers
0 votes
1 answer

The number of stages in a job is equal to the number of RDDs in DAG. however, under one of the cgiven conditions, the scheduler can truncate the lineage. identify it.

Hi@ritu, Spark's internal scheduler may truncate the lineage of the RDD graph if ...READ MORE

answered Nov 25, 2020 in Apache Spark by akhtar
• 38,260 points
2,643 views
0 votes
1 answer

Which one of the following commands is used to start python-spark?

Hi@ritu, To start your python spark shell, you ...READ MORE

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

which one of the following commands is used to see the structure of the Dataframe?

Hi @Ritu If you want to see the ...READ MORE

answered Nov 25, 2020 in Apache Spark by Gitika
• 65,770 points
2,405 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