Why it matters
PySpark performance often overlooked. Understanding shapes fast PySpark.
Advertisement
The architecture
Row UDF: slow (Python per row).
Pandas UDF: vectorized (batch of pandas).
Prefer SQL/DataFrame ops over UDF.
Advertisement
How it works end to end
Arrow: efficient Python ↔ JVM serialization.
Pandas UDFs: available since Spark 2.3; improved in 3.x.
Native ops preferred: filter, select, groupBy, join.