How can we construct an efficient query plan where execution is deferred until an explicit action is triggered?
Transformations build a directed acyclic graph (DAG) of execution steps without processing data until an action like write or count() runs.
Enabling Catalyst optimizer to combine filters, eliminate unused columns, and prune partitions before execution.
df_plan = df.filter(col("status") == "ACTIVE").select("user_id", "email")
total_active = df_plan.count()Practice typing production-grade PySpark code for Understanding Lazy Evaluation & Actions.