Difference between createTempview and createGlobaltempview and CreateorReplaceTempview in sparks 2.1?

What is the difference between createTempview

and createGlobaltempview

and CreateorReplaceTempview

in Spark 2.1?

+3


source to share


2 answers


Global temporary view

According to the documentation, a global temp view is a view that is shared across all sessions until all Spark applications are terminated.



createorReplaceTempview

createTempView

(or better createOrReplaceTempView

) was introduced in Spark 2.0 to replace it registerTempTable

, which was deprecated in 2.0. createTempView

creates a memory reference in Dataframe

. The lifetime for this is tied to the spark session in which it Dataframe

was created in

+1


source


According to the documentation:

Global Temporary View Temporary views in Spark SQL are session limited and disappear if the session that creates it ends. If you want the temporary view to be shared across all sessions and maintained until the Spark application exits, you can create a global temporary view.



createOrReplaceTempView Dataset and DataFrame API registerTempTable is deprecated and replaced with createOrReplaceTempView

0


source







All Articles