1. A data engineer writes the following PySpark code to join two DataFrames: ```python result = orders.join(customers, on='customer_id', how='left') ``` Which statement best describes the result?
- A. All rows from `customers` are returned; rows from `orders` without a matching `customer_id` are filled with NULLs.
- B. Only rows where `customer_id` exists in both `orders` and `customers` are returned.
- C. All rows from `orders` are returned; rows from `orders` without a matching `customer_id` in `customers` have NULL values for `customers` columns.✓ Correct
- D. All rows from both DataFrames are returned, with NULLs where there is no match on either side.
Explanation
Option C is correct: a LEFT join returns every row from the left DataFrame (`orders`), and for rows where `customer_id` has no match in `customers`, the columns sourced from `customers` are filled with NULLs. Option A describes a RIGHT join (all rows from the right table, `customers`). Option B describes an INNER join (only matching rows). Option D describes a FULL OUTER join (all rows from both sides with NULLs where there is no match).