Difference between createTempview and createGlobaltempview and CreateorReplaceTempview in sparks 2.1?
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
source to share
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
source to share