A Data Analyst needs to retrieve employees with 5 or more years of tenure.
Which code snippet filters and shows the list?
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
Ashley
1 day agoMona
6 days agoSantos
11 days agoTanesha
17 days agoAltha
22 days agoMarvel
27 days agoGianna
2 months agoNaomi
2 months agoDomitila
2 months agoTaryn
2 months agoDominga
2 months agoPatti
2 months agoTheresia
3 months agoVivienne
3 months agoKerry
3 months agoLeanna
3 months agoOdette
3 months agoNatalya
3 months ago