QuestionQ245

VerifiedUsing Spark SQL

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

Explanation

PySpark combines Column predicates with &, and each comparison must be enclosed in parentheses so the two Boolean column expressions are formed before they are combined. Python's and cannot combine PySpark Column objects.

Community Discussion

No comments yet. Be the first to start the discussion!