Difference between createOrReplaceTempView and registerTempTable

I am new to spark and tried several commands in sparkSql several times using python when I came across these two commands:

createOrReplaceTempView and registerTempTable.

What is the difference between the two teams ?. They seem to have the same set of features.

+4
source share
3 answers

registerTempTable is part of API 1.x and is deprecated in Spark 2.0.

createOrReplaceTempViewand createTempViewwere introduced in Spark 2.0 as a replacement for registerTempTable.

In addition, registerTempTablethey are createOrReplaceTempViewfunctionally equivalent, and the former calls the latter.

+5
source

createOrReplaceTempView registerTempTable , registerTempTable, , 2.0.

, : 2.0 createOrReplaceTempView.

https://spark.apache.org/docs/2.0.0/api/python/pyspark.sql.html

+1

createOrReplaceTempView registerTempTable .

registerTempTable 2.0.0

registerTempTable createOrReplaceTempView

@deprecated("Use createOrReplaceTempView(viewName) instead.", "2.0.0")
  def registerTempTable(tableName: String): Unit = {
    createOrReplaceTempView(tableName)
  }
0

Source: https://habr.com/ru/post/1681614/


All Articles