- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2024 03:41 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2024 05:11 AM
Do you face this issue without spark streaming as well? Also, could you share a minimal repo code preferably without streaming?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2024 08:49 PM - edited 01-30-2024 08:50 PM
Hi @Lakshay
Without structured streaming, I can able to create the tempview and make use of it in the same notebook.
But for the same, when I try to use in structured streaming, it is throwing the error message that view not found.
please refer the below sample code snippet for reference,