Question 540
A shared DataFrame transform mutates global configuration and succeeds alone but returns different results when called after another test. A data engineer uses `collect()` to validate ten million result rows, exhausting the driver during a job that previously scaled. Which response best addresses these needs?
Explanation
Correct Answer
Hidden mutable state makes ETL functions order-dependent and difficult to test. Large distributed results should not be materialized on a single driver just to confirm correctness.
Incorrect Answers
Raise or surface actionable failures with source context instead of treating arbitrary ingestion exceptions as valid empty input; replace full driver collection with distributed assertions, aggregates, or bounded samples; swallowing failures converts an operational outage into silent data loss; Requirement 1 requires: pass configuration explicitly and make the transformation deterministic for the same input DataFrame.
Large distributed results should not be materialized on a single driver just to confirm correctness; Requirement 1 requires: pass configuration explicitly and make the transformation deterministic for the same input DataFrame.
Repeatable fixtures make code defects distinguishable from live input changes; Requirement 2 requires: replace full driver collection with distributed assertions, aggregates, or bounded samples.






Certified Data Engineer Professional Practice Tests