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
238 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,870 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,140 points
376 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,180 points
293 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,140 points
89 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,870 points
192 views