create view
df.createOrReplaceTempView("Data")
EX:
dff_sql = spark.sql("select * from Data where delay > 5")