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
2 months agoLucina
2 months agoCarri
3 months agoHubert
3 months agoJustine
3 months agoAshley
3 months agoMona
3 months agoSantos
3 months agoTanesha
4 months agoAltha
4 months agoMarvel
4 months agoGianna
5 months agoNaomi
5 months agoDomitila
5 months agoTaryn
5 months agoDominga
5 months agoPatti
5 months agoTheresia
6 months agoVivienne
6 months agoKerry
6 months agoLeanna
6 months agoOdette
6 months agoNatalya
7 months agoJanet
10 days agoKerry
16 days agoMari
2 months ago