New Year Sale 2026! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Databricks Certified Associate Developer for Apache Spark 3.5 Exam - Topic 3 Question 9 Discussion

Actual exam question for Databricks's Databricks Certified Associate Developer for Apache Spark 3.5 exam
Question #: 9
Topic #: 3
[All Databricks Certified Associate Developer for Apache Spark 3.5 Questions]

A Data Analyst needs to retrieve employees with 5 or more years of tenure.

Which code snippet filters and shows the list?

Show Suggested Answer Hide Answer
Suggested Answer: A

To filter rows based on a condition and display them in Spark, use filter(...).show():

employees_df.filter(employees_df.tenure >= 5).show()

Option A is correct and shows the results.

Option B filters but doesn't display them.

Option C uses Python's built-in filter, not Spark.

Option D collects the results to the driver, which is unnecessary if .show() is sufficient.

Final Answer: A


Contribute your Thoughts:

0/2000 characters
Gianna
3 days ago
Option D seems like the best choice, it returns the full dataset instead of just showing it.
upvoted 0 times
...
Naomi
8 days ago
I'd go with option A, it's more explicit and easier to understand.
upvoted 0 times
...
Domitila
13 days ago
Option B looks good, it's clear and concise.
upvoted 0 times
...
Taryn
18 days ago
I feel like option D is also valid since .collect() would return the results, but I’m not sure if it’s necessary for just filtering.
upvoted 0 times
...
Dominga
24 days ago
Option C seems incomplete to me; I don't think you can just use filter like that without specifying the DataFrame.
upvoted 0 times
...
Patti
29 days ago
I remember practicing with the .where() method, so I feel like option B could be correct too.
upvoted 0 times
...
Theresia
1 month ago
I think option A looks familiar, but I'm not sure if it needs the .show() at the end.
upvoted 0 times
...
Vivienne
1 month ago
I'd go with option B. It's clear and concise, and the where() method is commonly used for filtering DataFrames.
upvoted 0 times
...
Kerry
1 month ago
I'm a bit confused by option C. Isn't filter() a DataFrame method, not a standalone function?
upvoted 0 times
...
Leanna
2 months ago
Option D might be good if I need to store the filtered results in a variable for later use. The collect() method will return a list of the matching rows.
upvoted 0 times
...
Odette
2 months ago
Hmm, I'm not sure about option A. Does the filter() method return a new DataFrame or just display the results?
upvoted 0 times
...
Natalya
2 months ago
I think option B looks the most straightforward. Just need to use the where() method to filter the DataFrame.
upvoted 0 times
...

Save Cancel