DE Mastery GitHub

Apache Spark · SPK-03

The DataFrame API

From your world. dbt staging models, written in PySpark

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

1orders has a NULL in the currency column for some rows. Which filter keeps ONLY rows whose currency is exactly 'USD', and what happens to the NULL rows?
2You must remove rows that repeat on (company_id, order_item_id, order_id). You must keep rows that only share an order_item_id across companies. Which is correct?
3payments.amount contains NULLs. What does F.sum('amount') return over a group where every amount is NULL?
4order_ts_raw is '2026-03-10T23:30:00-05:00'. The session timezone is UTC. Which approach gives the CORRECT calendar date for this instant?
5Which operations turn one input row that contains an array column into multiple output rows? (select all) (select all that apply)
6What is the difference between F.count('amount') and F.count(F.lit(1)) on a column with NULLs?
7You need the list of distinct currencies as a Python list on the driver. Which is appropriate for a SMALL result?
8Which statement about withColumn is TRUE?