Databricks Certified Associate Developer for Apache Spark — Question 21
Which of the following operations can be used to create a DataFrame with a subset of columns from DataFrame storesDF that are specified by name?
Answer options
- A. storesDF.subset()
- B. storesDF.select()
- C. storesDF.selectColumn()
- D. storesDF.filter()
- E. storesDF.drop()
Correct answer: B
Explanation
The correct answer is B, as the select() method is specifically designed to create a DataFrame with only the specified columns. The other options either do not exist or do not serve the purpose of selecting specific columns from a DataFrame.