spark context in databricks

Data_Engineer3
Contributor III

Hi @all,

In Azure Databricks,
I am using structured streaming for each batch functionality, in one of the functions I am creating tempview with pyspark dataframe (*Not GlobalTempView) and trying to access the same temp view by using spark.sql functionality.

But I am getting the error temp view not found, seems like the temp view is not created in the same spark context.

I want to create the temp view by using pyspark dataframe and access the tempview using spark sql function in structuring streaming. Could you please share the steps to create tempview and access within same databricks notebook.

is spark keyword and spark.sql will have different spark context within same databricks notebook? or both will have same context.

 

#databricks #pyspark #sparksql