What is the difference between createOrReplaceTempView and pyspark dataframe
I want to know the difference between a pyspark dataframe and a createOrReplaceTempView


I know that with pyspark dataframe I have to use python, and with the createOrReplaceTempView it is SQL, but in terms of memory, using the cluster, parallelizing, both are the same?

They're both should be similar

For example if I use .toPandas() I will put all the data in memory, does something similar happends with createOrReplaceTempView ? or is still distributed?

.toPandas() collect all data and return to driver's memory, createOrReplaceTempView is lazy
I want to know the difference between a pyspark dataframe and a createOrReplaceTempView
I know that with pyspark dataframe I have to use python, and with the createOrReplaceTempView  it is SQL, but in terms of memory, using the cluster, parallelizing, both are the same?
For example if I use .toPandas() I will put all the data in memory, does something similar happends with createOrReplaceTempView ? or is still distributed?
Also I would like to know, if I use CREATE OR REPLACE TEMP VIEW tablename how do I pass this table to a pyspark dataframe
Regards