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 22, 2020 in Apache Spark by ritu
• 980 points
646 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,950 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 25, 2020 in Apache Spark by MD
• 95,300 points
724 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,210 points
661 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,300 points
149 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,950 points
411 views