PySpark scoped temporary view

430 Views Asked by At

I am using PySpark SQL to create temporary views from dataframes and to make data processing with them. I created a python service where a user can hit some APIs where they can pass the dataframe and the SQL query to be applied to it to make the data processing. The problem comes when two users want to use the same name for a temporary view and I was wondering if there's a way to create a scoped temporary view on pyspark. I read that all temporary tables are session-scoped, but it appears to be shared between them.

I've thought of adding prefix the tables with the user name, but it would add extra complexity to the code.

0

There are 0 best solutions below