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
Gianna
3 days agoNaomi
8 days agoDomitila
13 days agoTaryn
18 days agoDominga
24 days agoPatti
29 days agoTheresia
1 month agoVivienne
1 month agoKerry
1 month agoLeanna
2 months agoOdette
2 months agoNatalya
2 months ago