Spark Dataset 2.0 provides two functions createOrReplaceTempView
and createGlobalTempView
. I am not able to understand the basic difference between both functions.
According to API documents:
createOrReplaceTempView: The lifetime of this
temporary view is tied to the [[SparkSession]] that was used to create this Dataset.
So, when I call sparkSession.close()
the defined will be destroyed. is it true?
createGlobalTempView: The lifetime of this temporary view is tied to this Spark application.
when this type of view will be destroyed? any example. like sparkSession.close()?