Skip to main content
PYSPARK โ€ข LESSON 65

Identifying Missing Data with isNull()

How do we query and inspect records where customer email addresses are missing?

Intermediateโฑ 2 Minutesโญ 320 XP
๐Ÿค” THE QUESTION

How do we query and inspect records where customer email addresses are missing?

๐Ÿ’ก WHAT IS IT?

isNull() returns a boolean Column evaluating to True if the referenced field is SQL NULL.

๐ŸŽฏ WHAT IS IT USED FOR?

Data profiling, isolating corrupted ingress payloads, and alerting on missing mandatory fields.

๐Ÿ’ป EXAMPLE
from pyspark.sql.functions import col

df.filter(col("email").isNull()).show()

๐ŸŽฏ Mission Objectives

Practice typing production-grade PySpark code for Identifying Missing Data with isNull().

  • โœ“ Use isNull() on Column object
  • โœ“ Filter missing email rows
  • โœ“ Display corrupted records for audit