Is there a way to include dataframes inside a sql query? I'm actually trying to break a huge sql query and put in multiple dataframes and call those dataframes inside the original query.
select * from DF alike?
You can create a Temporary View using Dataframe which can be used in Spark Sql
For e.g. If you have Dataframe 'df' then you can run this to create temporary View with any name e.g. "my_table"
df.createOrReplaceTempView("my_table")
Now you can run query on top of this using following to load this as newer dataframe:
df2 = spark.sql("select * from my_table")