Databricks Certified Associate Developer for Apache Spark — Question 23

Which of the following code blocks returns a DataFrame containing only the rows from DataFrame storesDF where the value in column sqft is less than or equal to 25,000 OR the value in column customerSatisfaction is greater than or equal to 30?

Answer options

Correct answer: E

Explanation

The correct answer is E because it correctly uses the filter method with proper syntax and logical operators to check both conditions. Option A uses the correct syntax but is not the most explicit, while B and C incorrectly use 'or' instead of '|', and D has a syntax error with col() usage.