Databricks Certified Associate Developer for Apache Spark — Question 131
Which of the following code blocks returns a new Data Frame from DataFrame storesDF with no duplicate rows?
Answer options
- A. storesDF.removeDuplicates()
- B. storesDF.getDistinct()
- C. storesDF.duplicates.drop()
- D. storesDF.duplicates()
- E. storesDF.dropDuplicates()
Correct answer: E
Explanation
The correct answer is E, as the dropDuplicates() method effectively removes duplicate rows from a DataFrame. The other options either do not exist as valid methods (A, B, C, D) or are incorrect in their functionality.