createOrReplaceTempView() creates/replaces a local temp view with the dataframe provided. A lifetime of this view is dependent on SparkSession class, if you want to drop this view :
spark.catalog.dropTempView("name")
createGlobalTempView() creates a global temporary view with the dataframe provided. A lifetime of this view is dependent to spark application itself. If you want to drop :
spark.catalog.dropGlobalTempView("name")
For more information regarding the same, refer the following video: