Interview practice question
Rows missing after a join on nullable keys
Data Engineering · Spark · Beginner
After joining two DataFrames on two key columns, many rows are missing. Some key values are null. Why?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- null == null is not true in Spark joins.
- Rows with null keys don't match in equality joins.
- Use eqNullSafe or the <=> operator if nulls should match.
- Or fill nulls with a default before joining.
- Decide with the business whether null keys should match.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.