6

I'm learning Spark and found that I can create temp view in Spark by calling one of following pySpark API:

df.createGlobalTempView("people") df.createTempView("people") df.createOrReplaceTempView'("people") 

Can I create a permanent view to that it became available for every user of my spark cluster? Think this will save people's time if views are already defined for them.

2 Answers 2

6

Yes, but you'll have to use SQL:

spark.sql("CREATE VIEW persistent_people AS SELECT * FROM people") 
Sign up to request clarification or add additional context in comments.

Comments

-4

By paradigm, Spark doesn't have any persistence capabilities since it's a data processing engine but not data warehousing.

If you want to provide some session independent views you need to work with existing Hive deployment or use an approach with Spark owned metastore. For more details please refer Spark doc about Hive interaction.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.