31. Fill Missing Dates (Calendar Spine)
Difficulty: Hard · Topics: Joins, Arrays, Aggregations, Dates, Null Handling, Filtering & Selection
An advanced problem: unlock it to open the statement, sample data and editor. Graded on 3 test cases.
Learn the concepts
- explode · 4 min read. Turn each array element into its own row, and the rows explode silently drops.
- Parsing dates and timestamps · 4 min read. to_date, to_timestamp and date_format patterns, and why yyyy and YYYY are not the same.
- fillna / dropna · 4 min read. Fill or drop missing values per column, and why fillna(0) leaves string columns alone.
PySpark functions you'll practise
- agg
- min
- max
- join
- explode
- sequence
- fillna
- to_date
- select
- withColumn
- orderBy
Related problems
- Monthly Retention by Cohort · Hard · Joins, Aggregations, Dates, Null Handling, Filtering & Selection
- Customers Who Bought Every Product · Hard · Joins, Aggregations, Filtering & Selection
- Price Valid at Order Time (Range Join) · Hard · Joins, Null Handling, Filtering & Selection
- Reconcile Two Sources (Full Outer Join) · Hard · Joins, Null Handling, Conditional Logic, Filtering & Selection
- Year-over-Year Growth · Medium · Joins, Filtering & Selection
Browse
Topics: Window Functions · Joins · Aggregations · Pivot, Unpivot & Rollup · Arrays · Null Handling · Conditional Logic · Dates · Filtering & Selection · Strings · Data Lake · Lakehouse · Streaming · Data Prep for AI · Spark Performance
Difficulty: Easy · Medium · Hard · Learn · All problems · dbt practice