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
Norah
20 days agoLucina
25 days agoCarri
1 month agoHubert
1 month agoJustine
1 month agoAshley
2 months agoMona
2 months agoSantos
2 months agoTanesha
2 months agoAltha
2 months agoMarvel
2 months agoGianna
3 months agoNaomi
3 months agoDomitila
3 months agoTaryn
4 months agoDominga
4 months agoPatti
4 months agoTheresia
4 months agoVivienne
4 months agoKerry
4 months agoLeanna
5 months agoOdette
5 months agoNatalya
5 months agoMari
15 days ago