QuestionQ288

VerifiedDeveloping Code for Data Processing using Python and SQL

The data engineering team maintains this code:

Question Image

Assuming the code produces logically correct results and the source-table data has been deduplicated and validated, which statement describes what happens when this code runs?

Explanation

The aggregation is calculated from all records in silver_customer_sales, and mode("overwrite").table("gold_customer_lifetime_sales_summary") writes the resulting DataFrame by replacing the existing gold table’s data. It does not use a primary-key merge, change detection, streaming state, or incremental processing. PySpark documents that saveAsTable saves the DataFrame as the named table and that overwrite mode overwrites existing data.

Learn more

Community Discussion

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