Crie tabela Pyspark SQL
df.createOrReplaceTempView("tableA")
spark.sql("SELECT count(*) from tableA").show()
Sore Stork
df.createOrReplaceTempView("tableA")
spark.sql("SELECT count(*) from tableA").show()