DE Mastery GitHub

Apache Spark · SPK-04

Spark SQL and data sources

From your world. dbt {{ ref() }} and marts vs. temp views and SQL on files

Practice quiz with instant feedback. For a scored run that counts toward your local progress, use uv run de quiz SPK-04.

1What does df.createOrReplaceTempView('stg_orders') do?
2A nightly job must REPLACE yesterday's output at a path. Which save mode is correct, and what bug does the wrong one cause?
3How do you query a Parquet file directly with SQL, without registering it first?
4Why supply an explicit schema when reading a production CSV instead of inferSchema=true?
5What is the main read-time benefit of df.write.partitionBy('company_id')?
6Which column is a POOR choice to partitionBy, and why?
7You create a table with saveAsTable (managed) and later DROP TABLE it. What happens to the underlying data files?
8A DataFrame transformation and the equivalent Spark SQL query differ how?