Вы можете обобщить оператор фильтра за один раз:
from pyspark.sql.functions import col, count, when
# Converts all unmatched filters to NULL and drops them.
df = df.select([when(col(c).contains('substring'), col(c)).alias(c) for c in df.columns]).na.drop()
ИЛИ
Вы можете просто зациклить столбцы и применить тот же фильтр:
for col in df.columns:
df = df.filter(df[col].contains("substring"))